From: Victor Julien Date: Thu, 25 Oct 2018 09:44:53 +0000 (+0200) Subject: pool: avoid possible double free in error path X-Git-Tag: suricata-4.0.6~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b09fa8f0887c46cb05ddabaf56895181a3a79bae;p=thirdparty%2Fsuricata.git pool: avoid possible double free in error path Should be impossible as a double free, but scan-build-7 thinks it is possible. --- diff --git a/src/util-pool.c b/src/util-pool.c index 3b5792e798..c88cc847cb 100644 --- a/src/util-pool.c +++ b/src/util-pool.c @@ -197,6 +197,7 @@ Pool *PoolInit(uint32_t size, uint32_t prealloc_size, uint32_t elt_size, SCLogError(SC_ERR_POOL_INIT, "init error"); if (p->Cleanup) p->Cleanup(pb->data); + pb->data = NULL; goto error; }