From cd825560a40615cb6ac614e79f63d80c98016adc Mon Sep 17 00:00:00 2001 From: Kevin Harwell Date: Fri, 30 Aug 2013 16:58:34 +0000 Subject: [PATCH] Fix memory leak Fixed a features.c test that leaked a reference to a parked call. This caused chancount to never reach 0, so graceful shutdown stops. Also added an unregister test. (closes issue ASTERISK-22413) Reported by: Corey Farrell Patches: features-TEST_FRAMEWORK.patch uploaded by coreyfarrell (license 5909) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@398021 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/features.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main/features.c b/main/features.c index 68c2de22eb..dce0723c3b 100644 --- a/main/features.c +++ b/main/features.c @@ -8249,6 +8249,7 @@ AST_TEST_DEFINE(features_test) } res = -1; } + parked_chan = ast_channel_unref(parked_chan); exit_features_test: @@ -8275,6 +8276,9 @@ static void features_shutdown(void) ast_unregister_application(parkcall); ast_unregister_application(parkedcall); ast_unregister_application(app_bridge); +#if defined(TEST_FRAMEWORK) + AST_TEST_UNREGISTER(features_test); +#endif /* defined(TEST_FRAMEWORK) */ pthread_cancel(parking_thread); pthread_kill(parking_thread, SIGURG);