Don't leak memory if phoneprov.conf does not exist
authorTerry Wilson <twilson@digium.com>
Fri, 9 Jan 2009 20:25:25 +0000 (20:25 +0000)
committerTerry Wilson <twilson@digium.com>
Fri, 9 Jan 2009 20:25:25 +0000 (20:25 +0000)
(closes issue #14203)
Reported by: jamesgolovich
Patches:
      asterisk-phoneprovleak.diff.txt uploaded by jamesgolovich (license 176)

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

res/res_phoneprov.c

index b05240a..d71139e 100644 (file)
@@ -944,6 +944,7 @@ static int set_config(void)
 
        if (!(phoneprov_cfg = ast_config_load("phoneprov.conf", config_flags)) || phoneprov_cfg == CONFIG_STATUS_FILEINVALID) {
                ast_log(LOG_ERROR, "Unable to load config phoneprov.conf\n");
+               ast_config_destroy(cfg);
                return -1;
        }