Skip to content

Commit

Permalink
ctl: safety check for closing fd
Browse files Browse the repository at this point in the history
(cherry picked from commit 24c4f35)
  • Loading branch information
miconda committed Aug 30, 2017
1 parent 7de2ea0 commit c23c5b4
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
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
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 c23c5b4

Please sign in to comment.