From 648907688771b1e29fe3960dd0f8a29d1b103881 Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Thu, 20 Sep 2007 16:10:57 +0000 Subject: Fix memory leaks in pbx_dundi, cdr_pgsql, and the configuration file parser. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83229 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- pbx/pbx_dundi.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'pbx') diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c index 7e91124af..08b9419e0 100644 --- a/pbx/pbx_dundi.c +++ b/pbx/pbx_dundi.c @@ -4635,19 +4635,16 @@ static int set_config(char *config_file, struct sockaddr_in* sin, int reload) int globalpcmodel = 0; dundi_eid testeid; - if ((cfg = ast_config_load(config_file, config_flags)) == CONFIG_STATUS_FILEUNCHANGED) + if (!(cfg = ast_config_load(config_file, config_flags))) { + ast_log(LOG_ERROR, "Unable to load config %s\n", config_file); + return -1; + } else if (cfg == CONFIG_STATUS_FILEUNCHANGED) return 0; dundi_ttl = DUNDI_DEFAULT_TTL; dundi_cache_time = DUNDI_DEFAULT_CACHE_TIME; any_peer = NULL; - - cfg = ast_config_load(config_file, config_flags); - - if (!cfg) { - ast_log(LOG_ERROR, "Unable to load config %s\n", config_file); - return -1; - } + ipaddr[0] = '\0'; if (!gethostname(hn, sizeof(hn)-1)) { hp = ast_gethostbyname(hn, &he); -- cgit v1.2.3