Skip to content

Commit

Permalink
ctl: safety check for closing fd
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Jul 30, 2017
1 parent 649b789 commit 24c4f35
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion src/modules/ctl/ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ static void mod_destroy(void)
switch(cs->transport){
case UNIXS_SOCK:
case UNIXD_SOCK:
close(cs->fd);
if(cs->fd>=0) close(cs->fd);
cs->fd=-1;
if (cs->write_fd!=-1){
close(cs->write_fd);
Expand Down
1 change: 0 additions & 1 deletion src/modules/ctl/ctrl_socks.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ struct id_list* parse_listen_id(char* l, int len, enum socket_protos def)

end:
/* fix all the stuff */
if (name==0) goto error;
if (proto==UNKNOWN_SOCK){
/* try to guess */
if (port_str){
Expand Down

0 comments on commit 24c4f35

Please sign in to comment.