Skip to content

Commit

Permalink
Fixes double close
Browse files Browse the repository at this point in the history
  • Loading branch information
davidvossel committed Jul 22, 2013
1 parent 9102c8d commit f14be87
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/ipc_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ qb_ipcs_us_connect(struct qb_ipcs_service *s,
ctl->flow_control = 0;

close(fd_hdr);
fd_hdr = -1;

/* request channel */
res = qb_ipc_dgram_sock_setup(r->response, "request",
Expand Down Expand Up @@ -618,7 +619,9 @@ qb_ipcs_us_connect(struct qb_ipcs_service *s,
free(c->response.u.us.sock_name);
free(c->event.u.us.sock_name);

close(fd_hdr);
if (fd_hdr >= 0) {
close(fd_hdr);
}
unlink(r->request);
munmap(c->request.u.us.shared_data, SHM_CONTROL_SIZE);
return res;
Expand Down

0 comments on commit f14be87

Please sign in to comment.