test_stasis.c: Fix ref leak in normal execution path.
authorRichard Mudgett <rmudgett@digium.com>
Fri, 3 Jan 2014 18:33:19 +0000 (18:33 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Fri, 3 Jan 2014 18:33:19 +0000 (18:33 +0000)
........

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

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

tests/test_stasis.c

index 7a297ce..48d5a6c 100644 (file)
@@ -810,6 +810,7 @@ AST_TEST_DEFINE(cache_dump)
        ast_test_validate(test, 2 == actual_len);
 
        /* Check the cache */
+       ao2_cleanup(cache_dump);
        cache_dump = stasis_cache_dump(cache, NULL);
        ast_test_validate(test, NULL != cache_dump);
        ast_test_validate(test, 2 == ao2_container_count(cache_dump));
@@ -829,6 +830,7 @@ AST_TEST_DEFINE(cache_dump)
        ast_test_validate(test, 3 == actual_len);
 
        /* Check the cache */
+       ao2_cleanup(cache_dump);
        cache_dump = stasis_cache_dump(cache, NULL);
        ast_test_validate(test, NULL != cache_dump);
        ast_test_validate(test, 2 == ao2_container_count(cache_dump));
@@ -848,6 +850,7 @@ AST_TEST_DEFINE(cache_dump)
        ast_test_validate(test, 4 == actual_len);
 
        /* Check the cache */
+       ao2_cleanup(cache_dump);
        cache_dump = stasis_cache_dump(cache, NULL);
        ast_test_validate(test, NULL != cache_dump);
        ast_test_validate(test, 1 == ao2_container_count(cache_dump));