aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'hal-0.5.11-patches/0005-fixed-memory-leaks-related-to-usage-of-g_strsplit.patch')
-rw-r--r--hal-0.5.11-patches/0005-fixed-memory-leaks-related-to-usage-of-g_strsplit.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/hal-0.5.11-patches/0005-fixed-memory-leaks-related-to-usage-of-g_strsplit.patch b/hal-0.5.11-patches/0005-fixed-memory-leaks-related-to-usage-of-g_strsplit.patch
new file mode 100644
index 00000000..ee7f8d99
--- /dev/null
+++ b/hal-0.5.11-patches/0005-fixed-memory-leaks-related-to-usage-of-g_strsplit.patch
@@ -0,0 +1,58 @@
+From 1302e611dcd0d081fe1adf92b162aed16561dc8d Mon Sep 17 00:00:00 2001
+From: Danny Kukawka <danny.kukawka@web.de>
+Date: Tue, 17 Jun 2008 19:54:50 +0200
+Subject: [PATCH 05/48] 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.
+---
+ hald/hald_dbus.c | 3 ++-
+ hald/linux/device.c | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+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 cf884e1..8bbe949 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;
+ }
+--
+1.6.1.2
+