[gthumb] fixed _g_string_list_to_strv memory allocation



commit a842a834c0f61af593178dff21b79327d806e958
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Tue Feb 16 10:41:40 2010 +0100

    fixed _g_string_list_to_strv memory allocation

 gthumb/glib-utils.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gthumb/glib-utils.c b/gthumb/glib-utils.c
index ca1dcd2..10e6264 100644
--- a/gthumb/glib-utils.c
+++ b/gthumb/glib-utils.c
@@ -1439,7 +1439,7 @@ _g_string_list_to_strv (GList *string_list)
 	GList  *scan;
 	int     i;
 
-	strv = g_new0 (char *, g_list_length (string_list));
+	strv = g_new0 (char *, g_list_length (string_list) + 1);
 	for (scan = string_list, i = 0; scan; scan = scan->next)
 		strv[i++] = g_strdup ((char *)scan->data);
 	strv[i++] = NULL;



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