From: Walter Doekes Date: Thu, 2 Jul 2015 11:19:34 +0000 (+0200) Subject: chan_mgcp: Don't call close on fd -1. X-Git-Tag: 11.19.0-rc1~20^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6bbc4f16e52d421e4404c1e6719fbe33cbb9463;p=thirdparty%2Fasterisk.git chan_mgcp: Don't call close on fd -1. ASTERISK-25220 #close Change-Id: Ic48f3a82f51ada87f2fb0e016c9efe0ad56f1ee3 --- diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c index 7e5cc92bd6..7154f43351 100644 --- a/channels/chan_mgcp.c +++ b/channels/chan_mgcp.c @@ -4944,7 +4944,9 @@ static int unload_module(void) return -1; } - close(mgcpsock); + if (mgcpsock > -1) { + close(mgcpsock); + } ast_rtp_glue_unregister(&mgcp_rtp_glue); ast_cli_unregister_multiple(cli_mgcp, sizeof(cli_mgcp) / sizeof(struct ast_cli_entry)); ast_sched_context_destroy(sched);