summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/remove.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/remove.c')
-rw-r--r--lib/libalpm/remove.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index 5b7fd418..3e810203 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -83,7 +83,8 @@ int remove_prepare(pmtrans_t *trans, pmdb_t *db, PMList **data)
EVENT(trans, PM_TRANS_EVT_CHECKDEPS_START, NULL, NULL);
_alpm_log(PM_LOG_FLOW1, "looking for unsatisfied dependencies");
- if((lp = checkdeps(db, trans->type, trans->packages)) != NULL) {
+ lp = checkdeps(db, trans->type, trans->packages);
+ if(lp != NULL) {
if(trans->flags & PM_TRANS_FLAG_CASCADE) {
while(lp) {
PMList *j;
@@ -101,6 +102,8 @@ int remove_prepare(pmtrans_t *trans, pmdb_t *db, PMList **data)
} else {
if(data) {
*data = lp;
+ } else {
+ FREELIST(lp);
}
RET_ERR(PM_ERR_UNSATISFIED_DEPS, -1);
}