diff options
author | Matthew Jordan <mjordan@digium.com> | 2012-01-04 21:40:45 +0000 |
---|---|---|
committer | Matthew Jordan <mjordan@digium.com> | 2012-01-04 21:40:45 +0000 |
commit | 12e3f412b5de2c6ddbeaf24ed745875f5ad4cac0 (patch) | |
tree | 24c578ae04dc2b12756304d68b98aefc149d9614 | |
parent | 963d52f63ee838a51cf8ed2509b27415dd718bd0 (diff) |
Free successfully translated frame in fax_gateway_framehook
A frame that is translated via ast_translate is also duplicated via ast_frdup.
This will allocate a new frame on the heap, which needs to be free'd
at the appropriate time. This issue reporter used valgrind to find that this
occurred in res_fax's fax_gateway_framehook; a quick search through the code
showed that only place this was currently not handling the translatted frame
properly.
(closes issue ASTERISK-19133)
Reported by: Sylvain Rochet
........
Merged revisions 349608 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349609 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | res/res_fax.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/res/res_fax.c b/res/res_fax.c index 7ee4cceff..360c2d9d2 100644 --- a/res/res_fax.c +++ b/res/res_fax.c @@ -3086,6 +3086,7 @@ static struct ast_frame *fax_gateway_framehook(struct ast_channel *chan, struct * write would fail, or even if a failure would be fatal so for * now we'll just ignore the return value. */ gateway->s->tech->write(gateway->s, f); + ast_frfree(f); f = &ast_null_frame; ao2_ref(details, -1); return f; |