hal: Branch 'master'

Danny Kukawka dkukawka at kemper.freedesktop.org
Tue Jun 17 10:56:42 PDT 2008


 hald/hald_dbus.c    |    3 ++-
 hald/linux/device.c |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit d2572a16cd5e6a5e5bab066595f43125ccdeb64a
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Tue Jun 17 19:54:50 2008 +0200

    fixed memory leaks related to usage of g_strsplit
    
    Fixed two memory leaks related to usage of g_strsplit, free
    returned char** after usage with g_strfreev() as pointed out
    by Tomasz Ostrowski in fd.o #16376.

diff --git a/hald/hald_dbus.c b/hald/hald_dbus.c
index 819ab9c..6889275 100644
--- a/hald/hald_dbus.c
+++ b/hald/hald_dbus.c
@@ -4679,7 +4679,7 @@ do_introspect (DBusConnection  *connection,
 					const char *name;
 					const char *sig;
 					const char *argnames;
-					char **args;
+					gchar **args;
 					unsigned int n;
 					unsigned int m;
 
@@ -4722,6 +4722,7 @@ do_introspect (DBusConnection  *connection,
 						xml, 
 						"    </method>\n");
 
+					g_strfreev(args);
 				}
 				
 
diff --git a/hald/linux/device.c b/hald/linux/device.c
index ac242ec..72bff9c 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -93,7 +93,7 @@ static int
 input_str_to_bitmask (const char *s, long *bitmask, size_t max_size)
 {
 	int i, j;
-	char **v;
+	gchar **v;
 	int num_bits_set = 0;
 
 	memset (bitmask, 0, max_size);
@@ -109,6 +109,7 @@ input_str_to_bitmask (const char *s, long *bitmask, size_t max_size)
 			val &= (val - 1);
 		}
 	}
+	g_strfreev(v);
 
 	return num_bits_set;
 }


More information about the hal-commit mailing list