From: Corey Farrell Date: Wed, 22 Jun 2016 20:04:54 +0000 (-0400) Subject: res_fax: Fix reference leak in fax_v21_session_new. X-Git-Tag: 13.10.0-rc1~5^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d904659ec3aa23565aa54690961048be7ec7f4c;p=thirdparty%2Fasterisk.git 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 --- diff --git a/res/res_fax.c b/res/res_fax.c index 6282b13d74..ad6e2386c9 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; }