X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=chan_lcr.c;h=e8e2e7e6e132f51e951f3a237a4eddc356c8152d;hp=3cf892cb735506a9d4bb8eab456565674c9a5f20;hb=9464c059e6059a4215f772882da1cdf72a183ce5;hpb=65ce8fa13ae31de2ff252b200e9ea3ee45d11343 diff --git a/chan_lcr.c b/chan_lcr.c index 3cf892c..e8e2e7e 100644 --- a/chan_lcr.c +++ b/chan_lcr.c @@ -1841,6 +1841,10 @@ void close_socket(void) { struct admin_list *admin, *temp; + /* socket not created */ + if (lcr_sock < 0) + return; + unregister_fd(&socket_fd); /* flush pending messages */ @@ -1853,8 +1857,7 @@ void close_socket(void) admin_first = NULL; /* close socket */ - if (lcr_sock >= 0) - close(lcr_sock); + close(lcr_sock); lcr_sock = -1; global_change = 1; }