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



commit ee08b7f875866f3fa35a2c621eeac3777ee27685
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 19ca925..17b8c24 100644
--- a/src/gconf-helpers/gconf-helpers.c
+++ b/src/gconf-helpers/gconf-helpers.c
@@ -762,10 +762,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;
@@ -818,16 +818,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]