From: Michael Tremer Date: Thu, 30 Nov 2017 15:54:03 +0000 (+0100) Subject: pool: Don't try to initialize pool when allocation has failed X-Git-Tag: 0.9.28~1285^2~1227 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=77ccb68665e825b745fc8511a6d7afa70e70817d;p=pakfire.git pool: Don't try to initialize pool when allocation has failed Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/pool.c b/src/libpakfire/pool.c index a81c25a3a..6edf8c34d 100644 --- a/src/libpakfire/pool.c +++ b/src/libpakfire/pool.c @@ -39,14 +39,15 @@ PakfirePool pakfire_pool_create(Pakfire pakfire) { PakfirePool pool = pakfire_calloc(1, sizeof(*pool)); if (pool) { pool->nrefs = 1; - } - pool->pool = pool_create(); - queue_init(&pool->installonly); + // Initialize pool + pool->pool = pool_create(); + queue_init(&pool->installonly); - // Set architecture - const char* arch = pakfire_get_arch(pakfire); - pool_setarch(pool->pool, arch); + // Set architecture + const char* arch = pakfire_get_arch(pakfire); + pool_setarch(pool->pool, arch); + } return pool; }