af-packet: add sanity check in free function

pull/471/head
Eric Leblond 12 years ago committed by Victor Julien
parent 8e68b357c7
commit 4424f5a231

@ -884,6 +884,9 @@ static int AFPRefSocket(AFPPeer* peer)
*/
static int AFPDerefSocket(AFPPeer* peer)
{
if (peer == NULL)
return 1;
if (SC_ATOMIC_SUB(peer->sock_usage, 1) == 0) {
if (SC_ATOMIC_GET(peer->state) == AFP_STATE_DOWN) {
SCLogInfo("Cleaning socket connected to '%s'", peer->iface);

Loading…
Cancel
Save