hal: Branch 'master'

Danny Kukawka dkukawka at kemper.freedesktop.org
Wed Oct 17 04:25:19 PDT 2007


 hald/device_info.c   |    1 +
 hald/linux/apm.c     |    1 +
 hald/linux/hotplug.c |    2 ++
 hald/linux/pmu.c     |    2 ++
 4 files changed, 6 insertions(+)

New commits:
commit 1491787fdf29fd77e4cbd13af70434ee3e7032ee
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Wed Oct 17 13:25:09 2007 +0200

    fix GSList related memory leaks
    
    This fixes several memory leaks caused by not free'd GSList objects.

diff --git a/hald/device_info.c b/hald/device_info.c
index 2b18346..438ec52 100644
--- a/hald/device_info.c
+++ b/hald/device_info.c
@@ -621,6 +621,7 @@ handle_match (struct rule *rule, HalDevice *d)
 					break;
 
 			} /* for all siblings */
+			g_slist_free (siblings);			
 		}
 
 		return contains;
diff --git a/hald/linux/apm.c b/hald/linux/apm.c
index 11f56b9..79c54ad 100644
--- a/hald/linux/apm.c
+++ b/hald/linux/apm.c
@@ -81,6 +81,7 @@ apm_poll (gpointer data)
 		apm_rescan_device (d);
 	}
 
+	g_slist_free (devices);
 	return TRUE;
 }
 
diff --git a/hald/linux/hotplug.c b/hald/linux/hotplug.c
index d57a022..56db041 100644
--- a/hald/linux/hotplug.c
+++ b/hald/linux/hotplug.c
@@ -409,6 +409,7 @@ hotplug_reprobe_generate_remove_events (HalDevice *d)
 		child = HAL_DEVICE (i->data);
 		hotplug_reprobe_generate_remove_events (child);
 	}
+	g_slist_free (childs);
 
 	/* then remove self */
 	HAL_INFO (("Generate remove event for udi %s", hal_device_get_udi (d)));
@@ -492,6 +493,7 @@ hotplug_reprobe_generate_add_events (HalDevice *d)
 		child = HAL_DEVICE (i->data);
 		hotplug_reprobe_generate_add_events (child);
 	}
+	g_slist_free (childs);
 }
 
 gboolean
diff --git a/hald/linux/pmu.c b/hald/linux/pmu.c
index d8f6fc3..451ffac 100644
--- a/hald/linux/pmu.c
+++ b/hald/linux/pmu.c
@@ -251,6 +251,7 @@ pmu_poll (gpointer data)
 		}
 	}
 
+	g_slist_free (devices);
 	devices = hal_device_store_match_multiple_key_value_string (hald_get_gdl (),
 								    "info.category",
 								    "ac_adapter");
@@ -266,6 +267,7 @@ pmu_poll (gpointer data)
 		}
 	}
 
+	g_slist_free (devices);
 	return TRUE;
 }
 


More information about the hal-commit mailing list