Make sure we destroy the config structure on configuration failure.

Issue 11163, patch by eliel.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@88585 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4
Jason Parker 18 years ago
parent 1d5bf38048
commit 7fa3a53ec2

@ -16973,6 +16973,7 @@ static int reload_config(enum channelreloadreason reason)
} }
if (ast_find_ourip(&__ourip, bindaddr)) { if (ast_find_ourip(&__ourip, bindaddr)) {
ast_log(LOG_WARNING, "Unable to get own IP address, SIP disabled\n"); ast_log(LOG_WARNING, "Unable to get own IP address, SIP disabled\n");
ast_config_destroy(cfg);
return 0; return 0;
} }
if (!ntohs(bindaddr.sin_port)) if (!ntohs(bindaddr.sin_port))
@ -16987,6 +16988,7 @@ static int reload_config(enum channelreloadreason reason)
sipsock = socket(AF_INET, SOCK_DGRAM, 0); sipsock = socket(AF_INET, SOCK_DGRAM, 0);
if (sipsock < 0) { if (sipsock < 0) {
ast_log(LOG_WARNING, "Unable to create SIP socket: %s\n", strerror(errno)); ast_log(LOG_WARNING, "Unable to create SIP socket: %s\n", strerror(errno));
ast_config_destroy(cfg);
return -1; return -1;
} else { } else {
/* Allow SIP clients on the same host to access us: */ /* Allow SIP clients on the same host to access us: */

Loading…
Cancel
Save