summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2006-01-02 13:14:00 +0000
committerAurelien Foret <aurelien@archlinux.org>2006-01-02 13:14:00 +0000
commit64055e0f74ef5ed933988ff5af1743a919b9a325 (patch)
tree3413ef99a70f765bfd4df1ada9cdb464a4f8d6be /lib
parentd7f4350c298b804a287637857e4a5e945dfa0b7f (diff)
downloadpacman-64055e0f74ef5ed933988ff5af1743a919b9a325.tar.xz
fixed various memory leaks
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/add.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index ea0b29d2..3a610c85 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -191,7 +191,6 @@ error:
int add_prepare(pmtrans_t *trans, pmdb_t *db, PMList **data)
{
PMList *lp;
- PMList *skiplist = NULL;
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1));
@@ -266,6 +265,8 @@ int add_prepare(pmtrans_t *trans, pmdb_t *db, PMList **data)
/* Check for file conflicts
*/
if(!(trans->flags & PM_TRANS_FLAG_FORCE)) {
+ PMList *skiplist = NULL;
+
EVENT(trans, PM_TRANS_EVT_FILECONFLICTS_START, NULL, NULL);
_alpm_log(PM_LOG_FLOW1, "looking for file conflicts");
@@ -280,6 +281,7 @@ int add_prepare(pmtrans_t *trans, pmdb_t *db, PMList **data)
for(lp = skiplist; lp; lp = lp->next) {
trans->skiplist = pm_list_add(trans->skiplist, lp->data);
}
+ FREELISTPTR(skiplist);
EVENT(trans, PM_TRANS_EVT_FILECONFLICTS_DONE, NULL, NULL);
}
@@ -459,6 +461,7 @@ int add_commit(pmtrans_t *trans, pmdb_t *db)
errors++;
unlink(temp);
FREE(temp);
+ FREE(md5_orig);
close(fd);
continue;
}