From 952e265b8f844e9c332e3b05be93931678c38c00 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 18 Jan 2010 00:26:50 +0100 Subject: [PATCH] xbps_repository_pool_init: fix memleaks in error paths, found by cppcheck. --HG-- extra : convert_revision : xtraeme%40gmail.com-20100117232650-qkg4zh4blx2mhy3d --- lib/repository_pool.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/repository_pool.c b/lib/repository_pool.c index 792ce043..7a8e87ee 100644 --- a/lib/repository_pool.c +++ b/lib/repository_pool.c @@ -101,16 +101,17 @@ xbps_repository_pool_init(void) rpool->rp_uri = prop_string_cstring(obj); if (rpool->rp_uri == NULL) { + free(rpool); free(plist); rv = errno; goto out; } rpool->rp_repod = prop_dictionary_internalize_from_file(plist); if (rpool->rp_repod == NULL) { + free(rpool->rp_uri); + free(rpool); free(plist); if (errno == ENOENT) { - free(rpool->rp_uri); - free(rpool); errno = 0; nmissing++; continue;