summaryrefslogtreecommitdiff
path: root/channels/chan_mgcp.c
diff options
context:
space:
mode:
authorWalter Doekes <walter+asterisk@wjd.nu>2015-07-02 13:19:34 +0200
committerWalter Doekes <walter+asterisk@wjd.nu>2015-07-02 06:22:18 -0500
commit6fbb58c7f708e7adf5cfa1d8b0a6f49a9f9e979c (patch)
treea47e2151bd0882a8bd312dc4bdf07c9ecc9f432b /channels/chan_mgcp.c
parentc12ace3ab31bd61606252f5a3721ce720d2ad209 (diff)
chan_mgcp: Don't call close on fd -1.
ASTERISK-25220 #close Change-Id: Ic48f3a82f51ada87f2fb0e016c9efe0ad56f1ee3
Diffstat (limited to 'channels/chan_mgcp.c')
-rw-r--r--channels/chan_mgcp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c
index 16d3c6550..d9e182cc7 100644
--- a/channels/chan_mgcp.c
+++ b/channels/chan_mgcp.c
@@ -5007,7 +5007,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);