From 0ef95757d6fed29b99d1ea08b78732b2a7fe0e2c Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Mon, 28 Mar 2005 07:45:24 +0000 Subject: added a FREELISTPTR macro to free a PMList without freeing its data --- lib/libalpm/deps.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'lib/libalpm/deps.c') diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 3e3bd267..9839014a 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -104,10 +104,7 @@ PMList *sortbydeps(PMList *targets, int mode) } if(clean && change) { /* free up targets -- it's local now */ - for(i = targets; i; i = i->next) { - i->data = NULL; - } - FREELIST(targets); + FREELISTPTR(targets); } targets = newtargs; clean = 1; @@ -116,10 +113,7 @@ PMList *sortbydeps(PMList *targets, int mode) /* we're removing packages, so reverse the order */ newtargs = _alpm_list_reverse(targets); /* free the old one */ - for(i = targets; i; i = i->next) { - i->data = NULL; - } - FREELIST(targets); + FREELISTPTR(targets); targets = newtargs; } -- cgit v1.2.3-24-g4f1b