summaryrefslogtreecommitdiff
path: root/lib/libalpm/add.c
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2005-03-28 07:45:24 +0000
committerAurelien Foret <aurelien@archlinux.org>2005-03-28 07:45:24 +0000
commit0ef95757d6fed29b99d1ea08b78732b2a7fe0e2c (patch)
tree533229e29f3d37f6cad859b97cc2d2d9b2dce6fd /lib/libalpm/add.c
parent350a3972d1d372a009c67aba5af4ff0d3e25e813 (diff)
downloadpacman-0ef95757d6fed29b99d1ea08b78732b2a7fe0e2c.tar.xz
added a FREELISTPTR macro to free a PMList without freeing its data
Diffstat (limited to 'lib/libalpm/add.c')
-rw-r--r--lib/libalpm/add.c11
1 files changed, 2 insertions, 9 deletions
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;