diff options
Diffstat (limited to 'res')
-rw-r--r-- | res/res_fax.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/res/res_fax.c b/res/res_fax.c index 360c2d9d2..e7070fff2 100644 --- a/res/res_fax.c +++ b/res/res_fax.c @@ -3086,7 +3086,11 @@ 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); + if ((f->frametype == AST_FRAME_VOICE) && (f->subclass.format.id != AST_FORMAT_SLINEAR) && active->readtrans) { + /* Only free the frame if we translated / duplicated it - otherwise, + * let whatever is outside the frame hook do it */ + ast_frfree(f); + } f = &ast_null_frame; ao2_ref(details, -1); return f; |