[Asterisk-code-review] chan mgcp: Don't call close on fd -1. (asterisk[13])

Walter Doekes asteriskteam at digium.com
Thu Jul 2 06:22:13 CDT 2015


Walter Doekes has uploaded a new change for review.

  https://gerrit.asterisk.org/769

Change subject: chan_mgcp: Don't call close on fd -1.
......................................................................

chan_mgcp: Don't call close on fd -1.

ASTERISK-25220 #close

Change-Id: Ic48f3a82f51ada87f2fb0e016c9efe0ad56f1ee3
---
M channels/chan_mgcp.c
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/69/769/1

diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c
index b75cd43..030df89 100644
--- a/channels/chan_mgcp.c
+++ b/channels/chan_mgcp.c
@@ -4995,7 +4995,9 @@
 		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);

-- 
To view, visit https://gerrit.asterisk.org/769
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic48f3a82f51ada87f2fb0e016c9efe0ad56f1ee3
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Walter Doekes <walter+asterisk at wjd.nu>



More information about the asterisk-code-review mailing list