aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-05-30 13:34:23 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-05-30 13:34:23 +0000
commit7de05be7343e1706ed12d6c1a82e4c81f3a85117 (patch)
tree05568bc8e7c44ad2a11e870576ee091bf54f2c1e /apps
parentd751321d9879523a234934dd69b26efc33e401f8 (diff)
Fix memory leak and remove useless coe (bug #4318, with mods)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5786 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rwxr-xr-xapps/app_queue.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index e5cba679b..06dcd061b 100755
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -1300,21 +1300,26 @@ static struct localuser *wait_for_answer(struct queue_ent *qe, struct localuser
if (!f || ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_HANGUP))) {
/* Got hung up */
*to=-1;
+ if (f)
+ ast_frfree(f);
return NULL;
}
- if (f && (f->frametype == AST_FRAME_DTMF) && caller_disconnect && (f->subclass == '*')) {
+ if ((f->frametype == AST_FRAME_DTMF) && caller_disconnect && (f->subclass == '*')) {
if (option_verbose > 3)
ast_verbose(VERBOSE_PREFIX_3 "User hit %c to disconnect call.\n", f->subclass);
*to=0;
+ ast_frfree(f);
return NULL;
}
- if (f && (f->frametype == AST_FRAME_DTMF) && (f->subclass != '*') && valid_exit(qe, f->subclass)) {
+ if ((f->frametype == AST_FRAME_DTMF) && (f->subclass != '*') && valid_exit(qe, f->subclass)) {
if (option_verbose > 3)
ast_verbose(VERBOSE_PREFIX_3 "User pressed digit: %c\n", f->subclass);
*to=0;
*digit=f->subclass;
+ ast_frfree(f);
return NULL;
}
+ ast_frfree(f);
}
if (!*to && (option_verbose > 2))
ast_verbose( VERBOSE_PREFIX_3 "Nobody picked up in %d ms\n", orig);