From a3e0325075d43e560e779b7a9de327ab6d5cf7fd Mon Sep 17 00:00:00 2001 From: Gerardo Iglesias Galvan Date: Fri, 3 Jun 2011 00:18:53 -0500 Subject: [PATCH] Don't loose memory if PoolInit fails --- src/util-pool.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util-pool.c b/src/util-pool.c index 33cb3a379e..b42bf30624 100644 --- a/src/util-pool.c +++ b/src/util-pool.c @@ -101,7 +101,9 @@ Pool *PoolInit(uint32_t size, uint32_t prealloc_size, void *(*Alloc)(void *), vo return p; error: - /* XXX */ + if (p != NULL) { + PoolFree(p); + } return NULL; }