From: Giuseppe Longo Date: Wed, 5 Nov 2014 11:16:18 +0000 (+0100) Subject: pfring: fixes memleaks X-Git-Tag: suricata-2.1beta3~133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1229%2Fhead;p=thirdparty%2Fsuricata.git pfring: fixes memleaks This fixes some memory leaks Bug #1184 --- diff --git a/src/source-pfring.c b/src/source-pfring.c index fb4aed73a7..6f483ff741 100644 --- a/src/source-pfring.c +++ b/src/source-pfring.c @@ -406,12 +406,14 @@ TmEcode ReceivePfringThreadInit(ThreadVars *tv, void *initdata, void **data) ptv->interface = SCStrdup(pfconf->iface); if (unlikely(ptv->interface == NULL)) { SCLogError(SC_ERR_MEM_ALLOC, "Unable to allocate device string"); + SCFree(ptv); SCReturnInt(TM_ECODE_FAILED); } ptv->livedev = LiveGetDevice(pfconf->iface); if (ptv->livedev == NULL) { SCLogError(SC_ERR_INVALID_VALUE, "Unable to find Live device"); + SCFree(ptv); SCReturnInt(TM_ECODE_FAILED); } @@ -443,6 +445,7 @@ TmEcode ReceivePfringThreadInit(ThreadVars *tv, void *initdata, void **data) ptv->interface, ptv->interface); pfconf->DerefFunc(pfconf); + SCFree(ptv); return TM_ECODE_FAILED; } else { pfring_set_application_name(ptv->pd, PROG_NAME);