]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Make sure we destroy the config structure on configuration failure.
authorJason Parker <jparker@digium.com>
Mon, 5 Nov 2007 17:19:41 +0000 (17:19 +0000)
committerJason Parker <jparker@digium.com>
Mon, 5 Nov 2007 17:19:41 +0000 (17:19 +0000)
Issue 11163, patch by eliel.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@88585 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 800050ddc58e3c8863b772e7f69c378c8c2c40cf..5fba75f36b2c6f19866b67b767c2620a91240a3d 100644 (file)
@@ -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: */