diff --git a/cdr/cdr_tds.c b/cdr/cdr_tds.c index 444751d1a9..2536fae079 100644 --- a/cdr/cdr_tds.c +++ b/cdr/cdr_tds.c @@ -441,9 +441,11 @@ static int tds_load_module(void) } var = ast_variable_browse(cfg, "global"); - if (!var) /* nothing configured */ + if (!var) /* nothing configured */ { + ast_config_destroy(cfg); return 0; - + } + ptr = ast_variable_retrieve(cfg, "global", "hostname"); if (ptr) hostname = strdup(ptr); diff --git a/pbx/pbx_ael.c b/pbx/pbx_ael.c index 1a53c744b5..2af624c4f7 100644 --- a/pbx/pbx_ael.c +++ b/pbx/pbx_ael.c @@ -2993,7 +2993,7 @@ static void gen_prios(struct ael_extension *exten, char *label, pval *statement, strncat(buf2,strp2+1, sizeof(buf2)-strlen(strp2+1)-2); strcat(buf2,"]"); for_init->appargs = strdup(buf2); - for_init->app = strdup("Set"); + /* for_init->app = strdup("Set"); just set! */ } else { strp2 = p->u1.for_init; while (*strp2 && isspace(*strp2)) @@ -3015,7 +3015,8 @@ static void gen_prios(struct ael_extension *exten, char *label, pval *statement, *strp3 = 0; /* remove the closing paren */ for_init->appargs = strdup(buf2); - + if (for_init->app) + free(for_init->app); for_init->app = strdup("Macro"); } else { /* must be a regular app call */ char *strp3; @@ -3023,6 +3024,8 @@ static void gen_prios(struct ael_extension *exten, char *label, pval *statement, strp3 = strchr(buf2,'('); if (strp3) { *strp3 = 0; + if (for_init->app) + free(for_init->app); for_init->app = strdup(buf2); for_init->appargs = strdup(strp3+1); strp3 = strrchr(for_init->appargs, ')'); diff --git a/res/res_jabber.c b/res/res_jabber.c index df44101530..d106cd4a1e 100644 --- a/res/res_jabber.c +++ b/res/res_jabber.c @@ -2354,6 +2354,7 @@ static int aji_load_config(void) } cat = ast_category_browse(cfg, cat); } + ast_config_destroy(cfg); /* or leak memory */ return 1; }