]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Add missing free's in rare circumstances (bug #2985)
authorRussell Bryant <russell@russellbryant.com>
Mon, 6 Dec 2004 23:15:19 +0000 (23:15 +0000)
committerRussell Bryant <russell@russellbryant.com>
Mon, 6 Dec 2004 23:15:19 +0000 (23:15 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@4394 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_dial.c

index d1e03c2227686faceec1b67aea86726095924ea0..cc2b4b62f82dd48ac21edd1d16336d87c400142f 100755 (executable)
@@ -384,6 +384,8 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
                                /* Got hung up */
                                *to=-1;
                                strncpy(status, "CANCEL", statussize - 1);
+                               if (f)
+                                       ast_frfree(f);
                                return NULL;
                        }
                        if (f && (f->frametype == AST_FRAME_DTMF) && *allowdisconnect_out &&
@@ -392,6 +394,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
                                ast_verbose(VERBOSE_PREFIX_3 "User hit %c to disconnect call.\n", f->subclass);
                                *to=0;
                                strcpy(status, "CANCEL");
+                               ast_frfree(f);
                                return NULL;
                        }
                        if (single && ((f->frametype == AST_FRAME_VOICE) || (f->frametype == AST_FRAME_DTMF)))  {