Contents of /trunk/hal/patches/hal-0.5.10-fix-GSList-related-memory-leaks.patch
Parent Directory | Revision Log
Revision 597 -
(show annotations)
(download)
Mon May 19 19:05:19 2008 UTC (16 years, 4 months ago) by niro
File size: 2086 byte(s)
Mon May 19 19:05:19 2008 UTC (16 years, 4 months ago) by niro
File size: 2086 byte(s)
-gentoo patches
1 | From 9fb918f4d319795699b9963c3eaa58246227dede Mon Sep 17 00:00:00 2001 |
2 | From: Danny Kukawka <danny.kukawka@web.de> |
3 | Date: Wed, 17 Oct 2007 13:25:09 +0200 |
4 | Subject: [PATCH] fix GSList related memory leaks |
5 | |
6 | This fixes several memory leaks caused by not free'd GSList objects. |
7 | --- |
8 | hald/device_info.c | 1 + |
9 | hald/linux/apm.c | 1 + |
10 | hald/linux/hotplug.c | 2 ++ |
11 | hald/linux/pmu.c | 2 ++ |
12 | 4 files changed, 6 insertions(+), 0 deletions(-) |
13 | |
14 | diff --git a/hald/device_info.c b/hald/device_info.c |
15 | index 2b18346..438ec52 100644 |
16 | --- a/hald/device_info.c |
17 | +++ b/hald/device_info.c |
18 | @@ -621,6 +621,7 @@ handle_match (struct rule *rule, HalDevice *d) |
19 | break; |
20 | |
21 | } /* for all siblings */ |
22 | + g_slist_free (siblings); |
23 | } |
24 | |
25 | return contains; |
26 | diff --git a/hald/linux/apm.c b/hald/linux/apm.c |
27 | index 11f56b9..79c54ad 100644 |
28 | --- a/hald/linux/apm.c |
29 | +++ b/hald/linux/apm.c |
30 | @@ -81,6 +81,7 @@ apm_poll (gpointer data) |
31 | apm_rescan_device (d); |
32 | } |
33 | |
34 | + g_slist_free (devices); |
35 | return TRUE; |
36 | } |
37 | |
38 | diff --git a/hald/linux/hotplug.c b/hald/linux/hotplug.c |
39 | index d57a022..56db041 100644 |
40 | --- a/hald/linux/hotplug.c |
41 | +++ b/hald/linux/hotplug.c |
42 | @@ -409,6 +409,7 @@ hotplug_reprobe_generate_remove_events (HalDevice *d) |
43 | child = HAL_DEVICE (i->data); |
44 | hotplug_reprobe_generate_remove_events (child); |
45 | } |
46 | + g_slist_free (childs); |
47 | |
48 | /* then remove self */ |
49 | HAL_INFO (("Generate remove event for udi %s", hal_device_get_udi (d))); |
50 | @@ -492,6 +493,7 @@ hotplug_reprobe_generate_add_events (HalDevice *d) |
51 | child = HAL_DEVICE (i->data); |
52 | hotplug_reprobe_generate_add_events (child); |
53 | } |
54 | + g_slist_free (childs); |
55 | } |
56 | |
57 | gboolean |
58 | diff --git a/hald/linux/pmu.c b/hald/linux/pmu.c |
59 | index d8f6fc3..451ffac 100644 |
60 | --- a/hald/linux/pmu.c |
61 | +++ b/hald/linux/pmu.c |
62 | @@ -251,6 +251,7 @@ pmu_poll (gpointer data) |
63 | } |
64 | } |
65 | |
66 | + g_slist_free (devices); |
67 | devices = hal_device_store_match_multiple_key_value_string (hald_get_gdl (), |
68 | "info.category", |
69 | "ac_adapter"); |
70 | @@ -266,6 +267,7 @@ pmu_poll (gpointer data) |
71 | } |
72 | } |
73 | |
74 | + g_slist_free (devices); |
75 | return TRUE; |
76 | } |
77 | |
78 | -- |
79 | 1.5.3.7 |
80 |