summaryrefslogtreecommitdiff
path: root/libhal
diff options
context:
space:
mode:
authorDirk Müller <dmueller@suse.de>2007-09-20 19:48:49 +0200
committerDanny Kukawka <danny.kukawka@web.de>2007-09-20 19:48:49 +0200
commit8fe351c3c324a115210d396d241c9878af743740 (patch)
treea99fc32a0cc5ae6337ac3ef7bfadff72c76bf847 /libhal
parent5dea29db08b7d8130f19c511250b849b8dca8c46 (diff)
fixed access of freed memory
Fixed access of freed memory in function libhal_free_property_set().
Diffstat (limited to 'libhal')
-rw-r--r--libhal/libhal.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libhal/libhal.c b/libhal/libhal.c
index 0f22543e..619b7a52 100644
--- a/libhal/libhal.c
+++ b/libhal/libhal.c
@@ -556,19 +556,21 @@ libhal_property_set_sort (LibHalPropertySet *set)
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);
}