]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
TEST_FRAMEWORK: Fix ref leak in feature activation
authorKinsey Moore <kmoore@digium.com>
Tue, 15 Jul 2014 23:03:40 +0000 (23:03 +0000)
committerKinsey Moore <kmoore@digium.com>
Tue, 15 Jul 2014 23:03:40 +0000 (23:03 +0000)
This fixes two reference leaks that would occur when TEST_FRAMEWORK was
enabled and features were successfully executed.
........

Merged revisions 418715 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418716 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/bridge_channel.c

index 4e1377558659d228a8441b392008f684e0312bb5..0948928eae13e889372a6b88fb78a393399eff64 100644 (file)
@@ -1477,11 +1477,16 @@ static void testsuite_notify_feature_success(struct ast_channel *chan, const cha
                        feature = "automixmon";
                } else if (!strcmp(dtmf, featuremap->parkcall)) {
                        feature = "parkcall";
-               } else if (!strcmp(dtmf, xfer->atxferthreeway)) {
+               }
+       } else if (xfer) {
+               if (!strcmp(dtmf, xfer->atxferthreeway)) {
                        feature = "atxferthreeway";
                }
        }
 
+       ao2_cleanup(featuremap);
+       ao2_cleanup(xfer);
+
        ast_test_suite_event_notify("FEATURE_DETECTION",
                        "Result: success\r\n"
                        "Feature: %s", feature);