]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_motif: Release format capabilities and config on module load error
authorCorey Farrell <git@cfware.com>
Sun, 5 Oct 2014 00:01:03 +0000 (00:01 +0000)
committerCorey Farrell <git@cfware.com>
Sun, 5 Oct 2014 00:01:03 +0000 (00:01 +0000)
ASTERISK-24384 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4043/
........

Merged revisions 424550 from http://svn.asterisk.org/svn/asterisk/branches/11

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

channels/chan_motif.c

index d222a0316b7f268c9abb562e48aee2cd4b379f89..b69371acfdf5572f967906b9416e11c3dc3cf43f 100644 (file)
@@ -2742,6 +2742,8 @@ static int load_module(void)
        if (aco_process_config(&cfg_info, 0)) {
                ast_log(LOG_ERROR, "Unable to read config file motif.conf. Module loaded but not running.\n");
                aco_info_destroy(&cfg_info);
+               ast_format_cap_destroy(jingle_tech.capabilities);
+               jingle_tech.capabilities = NULL;
                return AST_MODULE_LOAD_DECLINE;
        }
 
@@ -2772,6 +2774,10 @@ end:
        }
 
        aco_info_destroy(&cfg_info);
+       ao2_global_obj_release(globals);
+
+       ast_format_cap_destroy(jingle_tech.capabilities);
+       jingle_tech.capabilities = NULL;
 
        return AST_MODULE_LOAD_FAILURE;
 }