(cherry picked from commit 24c4f357ecc83ded4c8890ed4440a0252191b0a9)
@@ -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);
@@ -133,7 +133,6 @@ find_port:
end:
/* fix all the stuff */
- if (name==0) goto error;
if (proto==UNKNOWN_SOCK){
/* try to guess */
if (port_str){