From: Kevin Harwell Date: Fri, 30 Aug 2013 17:00:26 +0000 (+0000) Subject: Fix memory leak X-Git-Tag: 11.6.0-rc1~3^2~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c376008f50dcc9a714e791c7007270e840edae7;p=thirdparty%2Fasterisk.git 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) ........ Merged revisions 398021 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@398022 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/features.c b/main/features.c index 3e824752f9..0a3a24bd64 100644 --- a/main/features.c +++ b/main/features.c @@ -8850,6 +8850,7 @@ AST_TEST_DEFINE(features_test) } res = -1; } + parked_chan = ast_channel_unref(parked_chan); exit_features_test: @@ -9035,6 +9036,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);