[pacman-dev] [PATCH] _alpm_db_new: free memory on error
Allan McRae
allan at archlinux.org
Sun Dec 21 14:39:28 UTC 2014
Signed-off-by: Allan McRae <allan at archlinux.org>
---
lib/libalpm/db.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index 11e3a3b..0ca12d7 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 {
--
2.2.0
More information about the pacman-dev
mailing list