[network-manager-applet] gconf: fix accessing freed memory



commit 6718b0578662a5914cb6539bdf34379ab3c697ec
Author: JiÅ?í KlimeÅ¡ <jklimes redhat com>
Date:   Tue Mar 15 13:44:29 2011 +0100

    gconf: fix accessing freed memory

 src/gconf-helpers/gconf-helpers.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/gconf-helpers/gconf-helpers.c b/src/gconf-helpers/gconf-helpers.c
index 31fa8c7..38d6358 100644
--- a/src/gconf-helpers/gconf-helpers.c
+++ b/src/gconf-helpers/gconf-helpers.c
@@ -775,10 +775,10 @@ out:
 
 gboolean
 nm_gconf_get_ip6addr_array_helper (GConfClient *client,
-								   const char *path,
-								   const char *key,
-								   const char *setting,
-								   GPtrArray **value)
+                                   const char *path,
+                                   const char *key,
+                                   const char *setting,
+                                   GPtrArray **value)
 {
 	char *gc_key;
 	GConfValue *gc_value = NULL;
@@ -831,16 +831,17 @@ nm_gconf_get_ip6addr_array_helper (GConfClient *client,
 			g_free (addr);
 			continue;
 		}
-		g_free (addr);
 
 		memset (&rawgw, 0, sizeof (rawgw));
 		if (gw) {
 			if (inet_pton (AF_INET6, gw, &rawgw) <= 0) {
 				g_warning ("%s: %s contained bad gateway address: %s",
 						   __func__, gc_key, gw);
+				g_free (addr);
 				continue;
 			}
 		}
+		g_free (addr);
 
 		valarr = g_value_array_new (3);
 



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