[gconf] Realloc the correct amount of memory



commit 8b4ec8270824b4a235aa40df0493d8f5babb121c
Author: Matthew Garrett <mjg redhat com>
Date:   Mon Jul 12 13:41:34 2010 -0400

    Realloc the correct amount of memory
    
    Pointers are more than a byte long - make sure that we realloc enough space
    to fit another one.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=609187

 gsettings/gsettings-data-convert.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gsettings/gsettings-data-convert.c b/gsettings/gsettings-data-convert.c
index d61c4be..aa92710 100644
--- a/gsettings/gsettings-data-convert.c
+++ b/gsettings/gsettings-data-convert.c
@@ -449,7 +449,7 @@ main (int argc, char *argv[])
 
           /* Add the the file to the converted list */
           len = g_strv_length (converted);
-          converted = g_realloc (converted, len + 1);
+          converted = g_realloc (converted, (len + 2) * sizeof (gchar *));
           converted[len] = g_strdup (name);
           converted[len + 1] = NULL;
         }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]