unix-manager: fix memleak in error case (CID 1353491)

pull/1869/head
Victor Julien 10 years ago
parent e51707be90
commit f5ce7549be

@ -396,6 +396,8 @@ int UnixCommandAccept(UnixCommand *this)
uclient = UnixClientAlloc(); uclient = UnixClientAlloc();
if (unlikely(uclient == NULL)) { if (unlikely(uclient == NULL)) {
SCLogError(SC_ERR_MEM_ALLOC, "Can't allocate new client"); SCLogError(SC_ERR_MEM_ALLOC, "Can't allocate new client");
json_decref(server_msg);
close(client);
return 0; return 0;
} }
uclient->fd = client; uclient->fd = client;

Loading…
Cancel
Save