From: Jason Parker Date: Mon, 5 Nov 2007 17:19:41 +0000 (+0000) Subject: Make sure we destroy the config structure on configuration failure. X-Git-Tag: 1.4.14~64 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7fa3a53ec2a5cafa710f518f5f0eb9433b09b1ab;p=thirdparty%2Fasterisk.git 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 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 800050ddc5..5fba75f36b 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -16973,6 +16973,7 @@ static int reload_config(enum channelreloadreason reason) } if (ast_find_ourip(&__ourip, bindaddr)) { ast_log(LOG_WARNING, "Unable to get own IP address, SIP disabled\n"); + ast_config_destroy(cfg); return 0; } if (!ntohs(bindaddr.sin_port)) @@ -16987,6 +16988,7 @@ static int reload_config(enum channelreloadreason reason) sipsock = socket(AF_INET, SOCK_DGRAM, 0); if (sipsock < 0) { ast_log(LOG_WARNING, "Unable to create SIP socket: %s\n", strerror(errno)); + ast_config_destroy(cfg); return -1; } else { /* Allow SIP clients on the same host to access us: */