[Xfce4-commits] <tumbler:master> Fix memory leak in tumbler_util_get_supported_uri_schemes().

Jannis Pohlmann noreply at xfce.org
Thu Oct 8 16:42:01 CEST 2009


Updating branch refs/heads/master
         to 0368ed8b88ba63b440d4a370178868de63318e2a (commit)
       from b71b81fc102c2469af44290db6bd131d29f4ab26 (commit)

commit 0368ed8b88ba63b440d4a370178868de63318e2a
Author: Jannis Pohlmann <jannis at xfce.org>
Date:   Thu Oct 8 16:37:58 2009 +0200

    Fix memory leak in tumbler_util_get_supported_uri_schemes().

 tumbler/tumbler-util.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tumbler/tumbler-util.c b/tumbler/tumbler-util.c
index 1d5910e..7259bfb 100644
--- a/tumbler/tumbler-util.c
+++ b/tumbler/tumbler-util.c
@@ -58,10 +58,10 @@ tumbler_util_get_supported_uri_schemes (void)
     {
       /* it is not, so we need to copy the array and add "file" */
       length = g_strv_length ((GStrv) vfs_schemes);
-      uri_schemes = g_new0 (gchar *, length + 1);
+      uri_schemes = g_new0 (gchar *, length + 2);
       uri_schemes[0] = g_strdup ("file");
-      for (n = 0; n < length; ++n)
-        uri_schemes[1+n] = g_strdup (vfs_schemes[n]);
+      for (n = 1; n <= length; ++n)
+        uri_schemes[n] = g_strdup (vfs_schemes[n-1]);
       uri_schemes[n] = NULL;
     }
 



More information about the Xfce4-commits mailing list