mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-14 16:33:34 +00:00
In response to 10578, I just ran 1.4 thru valgrind; some of the config leakage I've already fixed, but it doesn't hurt to double check. I found and fixed leaks in res_jabber, cdr_tds, pbx_ael. Nothing major, tho.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89088 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -441,8 +441,10 @@ static int tds_load_module(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
var = ast_variable_browse(cfg, "global");
|
var = ast_variable_browse(cfg, "global");
|
||||||
if (!var) /* nothing configured */
|
if (!var) /* nothing configured */ {
|
||||||
|
ast_config_destroy(cfg);
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
ptr = ast_variable_retrieve(cfg, "global", "hostname");
|
ptr = ast_variable_retrieve(cfg, "global", "hostname");
|
||||||
if (ptr)
|
if (ptr)
|
||||||
|
@@ -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);
|
strncat(buf2,strp2+1, sizeof(buf2)-strlen(strp2+1)-2);
|
||||||
strcat(buf2,"]");
|
strcat(buf2,"]");
|
||||||
for_init->appargs = strdup(buf2);
|
for_init->appargs = strdup(buf2);
|
||||||
for_init->app = strdup("Set");
|
/* for_init->app = strdup("Set"); just set! */
|
||||||
} else {
|
} else {
|
||||||
strp2 = p->u1.for_init;
|
strp2 = p->u1.for_init;
|
||||||
while (*strp2 && isspace(*strp2))
|
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 */
|
*strp3 = 0; /* remove the closing paren */
|
||||||
|
|
||||||
for_init->appargs = strdup(buf2);
|
for_init->appargs = strdup(buf2);
|
||||||
|
if (for_init->app)
|
||||||
|
free(for_init->app);
|
||||||
for_init->app = strdup("Macro");
|
for_init->app = strdup("Macro");
|
||||||
} else { /* must be a regular app call */
|
} else { /* must be a regular app call */
|
||||||
char *strp3;
|
char *strp3;
|
||||||
@@ -3023,6 +3024,8 @@ static void gen_prios(struct ael_extension *exten, char *label, pval *statement,
|
|||||||
strp3 = strchr(buf2,'(');
|
strp3 = strchr(buf2,'(');
|
||||||
if (strp3) {
|
if (strp3) {
|
||||||
*strp3 = 0;
|
*strp3 = 0;
|
||||||
|
if (for_init->app)
|
||||||
|
free(for_init->app);
|
||||||
for_init->app = strdup(buf2);
|
for_init->app = strdup(buf2);
|
||||||
for_init->appargs = strdup(strp3+1);
|
for_init->appargs = strdup(strp3+1);
|
||||||
strp3 = strrchr(for_init->appargs, ')');
|
strp3 = strrchr(for_init->appargs, ')');
|
||||||
|
@@ -2354,6 +2354,7 @@ static int aji_load_config(void)
|
|||||||
}
|
}
|
||||||
cat = ast_category_browse(cfg, cat);
|
cat = ast_category_browse(cfg, cat);
|
||||||
}
|
}
|
||||||
|
ast_config_destroy(cfg); /* or leak memory */
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user