[Asterisk-code-review] app festival: Fix fd leak on connection failure. (asterisk[13])
Corey Farrell
asteriskteam at digium.com
Wed Dec 20 10:59:50 CST 2017
Corey Farrell has uploaded this change for review. ( https://gerrit.asterisk.org/7681
Change subject: app_festival: Fix fd leak on connection failure.
......................................................................
app_festival: Fix fd leak on connection failure.
Change-Id: If5efaddcf735ff7d17e55c36cc1388946cee9e0f
---
M apps/app_festival.c
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/81/7681/1
diff --git a/apps/app_festival.c b/apps/app_festival.c
index 7df8caf..117bc1a 100644
--- a/apps/app_festival.c
+++ b/apps/app_festival.c
@@ -405,6 +405,7 @@
if (serverhost == NULL) {
ast_log(LOG_WARNING, "festival_client: gethostbyname failed\n");
ast_config_destroy(cfg);
+ close(fd);
return -1;
}
memmove(&serv_addr.sin_addr, serverhost->h_addr, serverhost->h_length);
@@ -416,6 +417,7 @@
if (connect(fd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) != 0) {
ast_log(LOG_WARNING, "festival_client: connect to server failed\n");
ast_config_destroy(cfg);
+ close(fd);
return -1;
}
--
To view, visit https://gerrit.asterisk.org/7681
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: If5efaddcf735ff7d17e55c36cc1388946cee9e0f
Gerrit-Change-Number: 7681
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171220/b648fe9c/attachment.html>
More information about the asterisk-code-review
mailing list