Skip to content
Snippets Groups Projects
Commit cc2557e3 authored by Jenkins2's avatar Jenkins2 Committed by Gerrit Code Review
Browse files

Merge "app_festival: Fix fd leak on connection failure."

parents c7a0ad8b fff7782c
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment