aboutsummaryrefslogtreecommitdiffstats
path: root/pbx/pbx_dundi.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-09-20 16:10:57 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-09-20 16:10:57 +0000
commit43a4eed03510937efa2a5c023459af42358e1786 (patch)
treeed98e7ee5cd2a8248c3d68224d04f1d998d2481b /pbx/pbx_dundi.c
parenta35dd640cdbbe41347f01d70d63065349d0d7f77 (diff)
Fix memory leaks in pbx_dundi, cdr_pgsql, and the configuration file parser.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@83229 f38db490-d61c-443f-a65b-d21fe96a405b
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);