Merge pull request #167 from gao-yan/ipc-fd-memory-leaks

Fix: ipc: Prevent fd and memory leaks in handle_new_connection()
This commit is contained in:
chrissie-c 2016-01-08 09:30:41 +00:00
commit 3245d7ad1d

View File

@ -556,7 +556,14 @@ send_response:
"Error in connection setup (%s)",
c->description);
}
qb_ipcs_disconnect(c);
if (c->state == QB_IPCS_CONNECTION_INACTIVE) {
/* This removes the initial alloc ref */
qb_ipcs_connection_unref(c);
qb_ipcc_us_sock_close(sock);
} else {
qb_ipcs_disconnect(c);
}
}
return res;
}