[Asterisk-code-review] app festival: Fix fd leak on connection failure. (asterisk[13])
Jenkins2
asteriskteam at digium.com
Thu Dec 21 06:11:47 CST 2017
Jenkins2 has submitted this change and it was merged. ( 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(-)
Approvals:
Kevin Harwell: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
Jenkins2: Approved for Submit
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: merged
Gerrit-Change-Id: If5efaddcf735ff7d17e55c36cc1388946cee9e0f
Gerrit-Change-Number: 7681
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171221/25087839/attachment.html>
More information about the asterisk-code-review
mailing list