From 895780bd9aa53c0767a9067a166c60b5b0569c6d Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Mon, 22 Dec 2014 00:39:10 +1000 Subject: _alpm_db_new: free memory on error Signed-off-by: Allan McRae --- lib/libalpm/db.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libalpm/db.c') diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index 11e3a3b0..0ca12d70 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -331,7 +331,7 @@ alpm_db_t *_alpm_db_new(const char *treename, int is_local) alpm_db_t *db; CALLOC(db, 1, sizeof(alpm_db_t), return NULL); - STRDUP(db->treename, treename, return NULL); + STRDUP(db->treename, treename, FREE(db); return NULL); if(is_local) { db->status |= DB_STATUS_LOCAL; } else { -- cgit v1.2.3