summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libalpm/conflict.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c
index db07102c..63b83048 100644
--- a/lib/libalpm/conflict.c
+++ b/lib/libalpm/conflict.c
@@ -79,11 +79,15 @@ alpm_conflict_t *_alpm_conflict_dup(const alpm_conflict_t *conflict)
newconflict->package1_hash = conflict->package1_hash;
newconflict->package2_hash = conflict->package2_hash;
- STRDUP(newconflict->package1, conflict->package1, return NULL);
- STRDUP(newconflict->package2, conflict->package2, return NULL);
+ STRDUP(newconflict->package1, conflict->package1, goto error);
+ STRDUP(newconflict->package2, conflict->package2, goto error);
newconflict->reason = conflict->reason;
return newconflict;
+
+error:
+ alpm_conflict_free(newconflict);
+ return NULL;
}
/**