summaryrefslogtreecommitdiff
path: root/pbx/pbx_dundi.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2007-09-20 16:10:57 +0000
committerJoshua Colp <jcolp@digium.com>2007-09-20 16:10:57 +0000
commit648907688771b1e29fe3960dd0f8a29d1b103881 (patch)
treeed98e7ee5cd2a8248c3d68224d04f1d998d2481b /pbx/pbx_dundi.c
parentac5332c67483d6442c81cfe2b65bf0daf86ca6b8 (diff)
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
Diffstat (limited to 'pbx/pbx_dundi.c')
-rw-r--r--pbx/pbx_dundi.c13
1 files changed, 5 insertions, 8 deletions
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);