[Asterisk-code-review] app festival: Fix fd leak on connection failure. (asterisk[15])

Jenkins2 asteriskteam at digium.com
Thu Dec 21 06:29:15 CST 2017


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/7680 )

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 3e2e020..715437e 100644
--- a/apps/app_festival.c
+++ b/apps/app_festival.c
@@ -403,6 +403,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);
@@ -414,6 +415,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/7680
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: merged
Gerrit-Change-Id: If5efaddcf735ff7d17e55c36cc1388946cee9e0f
Gerrit-Change-Number: 7680
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/e58d6179/attachment.html>


More information about the asterisk-code-review mailing list