From: Andreas Eversberg Date: Thu, 1 Mar 2012 07:40:28 +0000 (+0100) Subject: Fixed chan_lcr unload bug, found by Patrick X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=commitdiff_plain;h=9464c059e6059a4215f772882da1cdf72a183ce5 Fixed chan_lcr unload bug, found by Patrick --- 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; }