summaryrefslogtreecommitdiff
path: root/res/ael/pval.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2007-09-25 13:41:02 +0000
committerJoshua Colp <jcolp@digium.com>2007-09-25 13:41:02 +0000
commit20a71bad79bac38781f6866174169ea49bf8c518 (patch)
treefc6ae25a1eb28705f5c51c4899659d1a2816591d /res/ael/pval.c
parent3a5f263bf0881333f3055a501710cd3613b79237 (diff)
Fix minor memory leak in pval.c. Overwriting a value without freeing the previous result is bad, mmmk?
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83758 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/ael/pval.c')
-rw-r--r--res/ael/pval.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/res/ael/pval.c b/res/ael/pval.c
index 360df8eb0..11c72532c 100644
--- a/res/ael/pval.c
+++ b/res/ael/pval.c
@@ -3144,7 +3144,6 @@ 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");
} else {
strp2 = p->u1.for_init;
while (*strp2 && isspace(*strp2))
@@ -3166,7 +3165,7 @@ static void gen_prios(struct ael_extension *exten, char *label, pval *statement,
*strp3 = 0; /* remove the closing paren */
for_init->appargs = strdup(buf2);
-
+ free(for_init->app);
for_init->app = strdup("Macro");
} else { /* must be a regular app call */
char *strp3;
@@ -3174,6 +3173,7 @@ static void gen_prios(struct ael_extension *exten, char *label, pval *statement,
strp3 = strchr(buf2,'(');
if (strp3) {
*strp3 = 0;
+ free(for_init->app);
for_init->app = strdup(buf2);
for_init->appargs = strdup(strp3+1);
strp3 = strrchr(for_init->appargs, ')');