From 16ff7cfa8ef2d50c97d79357c2b2c1fdc2bc241b Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Wed, 22 Feb 2006 20:49:33 +0000 Subject: improved _alpm_list_free handling --- lib/libalpm/list.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/libalpm/list.c') diff --git a/lib/libalpm/list.c b/lib/libalpm/list.c index 632ee2a3..0e1c9426 100644 --- a/lib/libalpm/list.c +++ b/lib/libalpm/list.c @@ -42,13 +42,15 @@ PMList *_alpm_list_new() return(list); } -void _alpm_list_free(PMList *list) +void _alpm_list_free(PMList *list, _alpm_fn_free fn) { PMList *ptr, *it = list; while(it) { ptr = it->next; - free(it->data); + if(fn) { + fn(it->data); + } free(it); it = ptr; } -- cgit v1.2.3-24-g4f1b