summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2014-12-21 14:48:48 +0100
committerAllan McRae <allan@archlinux.org>2014-12-24 02:19:29 +0100
commit32ebd7ad5d0c96951065ef251f1766637ae5dd66 (patch)
tree7571143eb2fbcbaf0b4728d2e0f8efae27777664 /lib
parentbf06efaa7831d9c18d6687f197303a688d843ca9 (diff)
downloadpacman-32ebd7ad5d0c96951065ef251f1766637ae5dd66.tar.gz
pacman-32ebd7ad5d0c96951065ef251f1766637ae5dd66.tar.xz
depmiss_new: free memory on error
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/deps.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index f2ee8f41..ca36270d 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -50,11 +50,15 @@ static alpm_depmissing_t *depmiss_new(const char *target, alpm_depend_t *dep,
MALLOC(miss, sizeof(alpm_depmissing_t), return NULL);
- STRDUP(miss->target, target, return NULL);
+ STRDUP(miss->target, target, goto error);
miss->depend = _alpm_dep_dup(dep);
- STRDUP(miss->causingpkg, causingpkg, return NULL);
+ STRDUP(miss->causingpkg, causingpkg, goto error);
return miss;
+
+error:
+ alpm_depmissing_free(miss);
+ return NULL;
}
void SYMEXPORT alpm_depmissing_free(alpm_depmissing_t *miss)