Fix a variety of memory leaks
[asterisk/asterisk.git] / channels / chan_sip.c
index 5d0cf0b..a21ebf3 100644 (file)
@@ -7657,6 +7657,7 @@ static struct ast_frame *sip_read(struct ast_channel *ast)
                                if (ast_async_goto(ast, target_context, "fax", 1)) {
                                        ast_log(LOG_NOTICE, "Failed to async goto '%s' into fax of '%s'\n", ast_channel_name(ast), target_context);
                                }
+                               ast_frfree(fr);
                                fr = &ast_null_frame;
                        } else {
                                ast_channel_lock(ast);
@@ -7668,6 +7669,7 @@ static struct ast_frame *sip_read(struct ast_channel *ast)
 
        /* Only allow audio through if they sent progress with SDP, or if the channel is actually answered */
        if (fr && fr->frametype == AST_FRAME_VOICE && p->invitestate != INV_EARLY_MEDIA && ast_channel_state(ast) != AST_STATE_UP) {
+               ast_frfree(fr);
                fr = &ast_null_frame;
        }