source-af-xdp.c:675:21: warning: Potential leak of memory pointed to by 'ptv' [unix.Malloc]
SCReturnInt(TM_ECODE_FAILED);
^~~~~~~~~~~~~~~
./util-debug.h:275:48: note: expanded from macro 'SCReturnInt'
#define SCReturnInt(x) return x
^
1 warning generated.
if (SetIfaceFlags(ptv->iface, IFF_PROMISC | IFF_UP) != 0) {
SCLogError("Failed to switch interface (%s) to promiscuous, error %s", ptv->iface,
strerror(errno));
+ SCFree(ptv);
SCReturnInt(TM_ECODE_FAILED);
}
}
/* Reserve memory for umem */
if (AcquireBuffer(ptv) != TM_ECODE_OK) {
+ SCFree(ptv);
SCReturnInt(TM_ECODE_FAILED);
}
if (AFXDPSocketCreation(ptv) != TM_ECODE_OK) {
+ ReceiveAFXDPThreadDeinit(tv, ptv);
SCReturnInt(TM_ECODE_FAILED);
}