hal: Branch 'master'

Danny Kukawka dkukawka at kemper.freedesktop.org
Thu Sep 20 10:48:58 PDT 2007


 libhal/libhal.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
diff-tree 8fe351c3c324a115210d396d241c9878af743740 (from 5dea29db08b7d8130f19c511250b849b8dca8c46)
Author: Dirk Müller <dmueller at suse.de>
Date:   Thu Sep 20 19:48:49 2007 +0200

    fixed access of freed memory
    
    Fixed access of freed memory in function libhal_free_property_set().

diff --git a/libhal/libhal.c b/libhal/libhal.c
index 0f22543..619b7a5 100644
--- a/libhal/libhal.c
+++ b/libhal/libhal.c
@@ -556,19 +556,21 @@ libhal_property_set_sort (LibHalProperty
 void
 libhal_free_property_set (LibHalPropertySet * set)
 {
-	LibHalProperty *p;
+	LibHalProperty *p, *p_old;
 
 	if (set == NULL) 
 		return;
 
-	for (p = set->properties; p != NULL; p=p->hh.next) {
+	for (p = set->properties; p != NULL;) {
 		HASH_DELETE (hh, set->properties, p);
 		free (p->key);
 		if (p->type == DBUS_TYPE_STRING)
 			free (p->v.str_value);
 		if (p->type == LIBHAL_PROPERTY_TYPE_STRLIST)
 			libhal_free_string_array (p->v.strlist_value);
-		free (p);
+		p_old = p;
+		p = p->hh.next;
+		free (p_old);
 	}
 	free (set);
 }


More information about the hal-commit mailing list