diff options
author | Corey Farrell <git@cfware.com> | 2016-06-22 16:04:54 -0400 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2016-06-22 15:11:57 -0500 |
commit | 8c7017f76e06644e6a0ad5e363465cd06c89078e (patch) | |
tree | 9bda15c2ede4450f24b796b4a4f795969ed45fff /res/res_fax.c | |
parent | df6f69ceb616d5b95f208f21b9a31f48bcee2e7e (diff) |
res_fax: Fix reference leak in fax_v21_session_new.
fax_v21_session_new created a session details object but only released
the allocation reference during error conditions. fax_session_new adds
it's own reference to details if needed so the caller is always
responsible for cleaning it's own reference.
ASTERISK-26141 #close
Change-Id: Ie7fc52a83b6596ce9ce2d5a2bd9f3e204f48fc88
Diffstat (limited to 'res/res_fax.c')
-rw-r--r-- | res/res_fax.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/res/res_fax.c b/res/res_fax.c index c8ff1e988..347168e56 100644 --- a/res/res_fax.c +++ b/res/res_fax.c @@ -2846,11 +2846,8 @@ static struct ast_fax_session *fax_v21_session_new (struct ast_channel *chan) { } v21_details->caps = AST_FAX_TECH_V21_DETECT; - if (!(v21_session = fax_session_new(v21_details, chan, NULL, NULL))) { - ao2_ref(v21_details, -1); - return NULL; - } - + v21_session = fax_session_new(v21_details, chan, NULL, NULL); + ao2_ref(v21_details, -1); return v21_session; } |