diff options
author | Corey Farrell <git@cfware.com> | 2017-12-20 01:53:17 -0500 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2017-12-20 01:53:17 -0500 |
commit | fff7782cf52fcd5d7235f153dbc1013332f2537a (patch) | |
tree | 26156e01141497a16d9892eb8f0c8eec47be6d35 /apps/app_festival.c | |
parent | 968993a297df673954dbd19c5ef41804ff98e267 (diff) |
app_festival: Fix fd leak on connection failure.
Change-Id: If5efaddcf735ff7d17e55c36cc1388946cee9e0f
Diffstat (limited to 'apps/app_festival.c')
-rw-r--r-- | apps/app_festival.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/app_festival.c b/apps/app_festival.c index 3e2e020b8..715437e7e 100644 --- a/apps/app_festival.c +++ b/apps/app_festival.c @@ -403,6 +403,7 @@ static int festival_exec(struct ast_channel *chan, const char *vdata) 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 @@ static int festival_exec(struct ast_channel *chan, const char *vdata) 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; } |