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/add.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'lib/libalpm/add.c') diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index 0bbf0755..dd99313a 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -193,10 +193,7 @@ int add_prepare(pmdb_t *db, pmtrans_t *trans, PMList **data) _alpm_log(PM_LOG_FLOW1, "sorting by dependencies"); lp = sortbydeps(trans->packages, PM_TRANS_TYPE_ADD); /* free the old alltargs */ - for(j = trans->packages; j; j = j->next) { - j->data = NULL; - } - FREELIST(trans->packages); + FREELISTPTR(trans->packages); trans->packages = lp; TRANS_CB(trans, PM_TRANS_EVT_DEPS_DONE, NULL, NULL); @@ -384,13 +381,9 @@ int add_commit(pmdb_t *db, pmtrans_t *trans) cache, thus eliminating the need for db_scan(DEPENDS) */ PMList *provides = _alpm_db_whatprovides(db, depend.name); if(provides) { - PMList *p; /* use the first one */ depinfo = db_scan(db, ((pmpkg_t *)provides->data)->name, INFRQ_DESC|INFRQ_DEPENDS); - for(p = provides; p; p = p->next) { - p->data = NULL; - } - FREELIST(provides); + FREELISTPTR(provides); if(depinfo == NULL) { /* wtf */ continue; -- cgit v1.2.3-70-g09d2