summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Antonuk <alan.antonuk@gmail.com>2015-10-24 21:20:45 -0700
committerAlan Antonuk <alan.antonuk@gmail.com>2015-10-24 21:20:45 -0700
commit100271ac4690680a22c3c3e7d1d565e41e2d2016 (patch)
tree631e32a89fd92e4c3a95fc43f2310c4e0ed94fa6
parent3249ee32f274883e27460ac5450434c97d43530d (diff)
downloadrabbitmq-c-100271ac4690680a22c3c3e7d1d565e41e2d2016.tar.gz
Lib: fix potential leak in mem_pool impl
amqp_pool_alloc will leak if the initial alloc succeeds, but the alloc for the block-list fails. This fixes that.
-rw-r--r--librabbitmq/amqp_mem.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/librabbitmq/amqp_mem.c b/librabbitmq/amqp_mem.c
index 9c8f413..9ee393c 100644
--- a/librabbitmq/amqp_mem.c
+++ b/librabbitmq/amqp_mem.c
@@ -136,6 +136,7 @@ void *amqp_pool_alloc(amqp_pool_t *pool, size_t amount)
return NULL;
}
if (!record_pool_block(&pool->large_blocks, result)) {
+ free(result);
return NULL;
}
return result;