[gitg] Fix possible NULL deref



commit 21842783bfe4aabe93f6236ea31d59bd98bdb4e4
Author: Garrett Regier <garrettregier gmail com>
Date:   Sat Jul 23 04:02:32 2011 -0700

    Fix possible NULL deref

 gitg/gitg-branch-actions.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gitg/gitg-branch-actions.c b/gitg/gitg-branch-actions.c
index 4edafb2..2d46d05 100644
--- a/gitg/gitg-branch-actions.c
+++ b/gitg/gitg-branch-actions.c
@@ -67,9 +67,11 @@ static gchar const **
 parse_valist (va_list ap)
 {
 	gchar const *a;
-	gchar const **ret = NULL;
+	gchar const **ret;
 	guint num = 0;
 
+	ret = g_new (gchar const *, 1);
+
 	while ( (a = va_arg (ap, gchar const *)) != NULL)
 	{
 		ret = g_realloc (ret, sizeof (gchar const *) * (++num + 1));



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