diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-03-26 00:30:54 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-03-26 00:30:54 +0000 |
commit | b149fbccf8def6d39ae598a982c6b36b5ee40288 (patch) | |
tree | 5ceea6de8af8206997892ee80de6a78b0d39bdb1 /apps | |
parent | b7abdc13be0f3e3704072e1b6e1b9ed8e4a98df2 (diff) |
Remove access to free'd memory fro dude's code
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@691 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rwxr-xr-x | apps/app_dial.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c index eff1214b3..e64a81cda 100755 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -83,7 +83,6 @@ struct localuser { int ringbackonly; int musiconhold; int dataquality; - int clearchannel; int allowdisconnect; struct localuser *next; }; @@ -299,6 +298,7 @@ static int dial_exec(struct ast_channel *chan, void *data) int allowdisconnect=0; int privacy=0; int resetcdr=0; + int clearchannel=0; char numsubst[AST_MAX_EXTENSION]; char restofit[AST_MAX_EXTENSION]; char *transfer = NULL; @@ -430,8 +430,9 @@ static int dial_exec(struct ast_channel *chan, void *data) tmp->allowdisconnect = 1; else tmp->allowdisconnect = 0; if (strchr(transfer, 'c')) - tmp->clearchannel = 1; - else tmp->clearchannel = 0; + clearchannel = 1; + else + clearchannel = 0; } strncpy(numsubst, number, sizeof(numsubst)-1); /* If we're dialing by extension, look at the extension to know what to dial */ @@ -548,13 +549,13 @@ static int dial_exec(struct ast_channel *chan, void *data) if (!strcmp(chan->type,"Zap")) { int x = 2; - if (tmp->dataquality || tmp->clearchannel) x = 0; + if (tmp->dataquality || clearchannel) x = 0; ast_channel_setoption(chan,AST_OPTION_TONE_VERIFY,&x,sizeof(char),0); } if (!strcmp(peer->type,"Zap")) { int x = 2; - if (tmp->dataquality || tmp->clearchannel) x = 0; + if (tmp->dataquality || clearchannel) x = 0; ast_channel_setoption(peer,AST_OPTION_TONE_VERIFY,&x,sizeof(char),0); } hanguptree(outgoing, peer); @@ -578,14 +579,14 @@ static int dial_exec(struct ast_channel *chan, void *data) ast_log(LOG_DEBUG, "app_dial: sendurl=%s.\n", url); ast_channel_sendurl( peer, url ); } /* /JDG */ - if (tmp->clearchannel) + if (clearchannel) { int x = 0; ast_channel_setoption(chan,AST_OPTION_AUDIO_MODE,&x,sizeof(char),0); ast_channel_setoption(peer,AST_OPTION_AUDIO_MODE,&x,sizeof(char),0); } res = ast_bridge_call(chan, peer, allowredir, allowdisconnect | tmp->clearchannel); - if (tmp->clearchannel) + if (clearchannel) { int x = 1; ast_channel_setoption(chan,AST_OPTION_AUDIO_MODE,&x,sizeof(char),0); |