func_jitterbuffer: fix frame leaks.

Fix code paths where it is possible for frames to leak.
Fix uninitialized variable in jb_get_fixed and jb_get_adaptive.

ASTERISK-22409 #related
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4128/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@427019 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Corey Farrell
2014-11-02 07:35:36 +00:00
parent 72bf6d5052
commit 0b55748232
2 changed files with 13 additions and 2 deletions

View File

@@ -647,7 +647,7 @@ static int jb_put_fixed(void *jb, struct ast_frame *fin, long now)
static int jb_get_fixed(void *jb, struct ast_frame **fout, long now, long interpl)
{
struct fixed_jb *fixedjb = (struct fixed_jb *) jb;
struct fixed_jb_frame frame;
struct fixed_jb_frame frame = { .data = &ast_null_frame };
int res;
res = fixed_jb_get(fixedjb, &frame, now, interpl);
@@ -743,7 +743,7 @@ static int jb_put_adaptive(void *jb, struct ast_frame *fin, long now)
static int jb_get_adaptive(void *jb, struct ast_frame **fout, long now, long interpl)
{
jitterbuf *adaptivejb = (jitterbuf *) jb;
jb_frame frame;
jb_frame frame = { .data = &ast_null_frame };
int res;
res = jb_get(adaptivejb, &frame, now, interpl);