]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_fax: Fix reference leak in fax_v21_session_new. 84/3084/1
authorCorey Farrell <git@cfware.com>
Wed, 22 Jun 2016 20:04:54 +0000 (16:04 -0400)
committerCorey Farrell <git@cfware.com>
Wed, 22 Jun 2016 20:11:44 +0000 (15:11 -0500)
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

res/res_fax.c

index 03a71b248256608132914eb6f19b06860b70904b..2f9d9ff745357617f2029372a7d01be5ed07eae8 100644 (file)
@@ -2554,11 +2554,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;
 }