[asterisk-commits] mjordan: trunk r386676 - in /trunk: ./ main/features.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Apr 26 16:27:27 CDT 2013


Author: mjordan
Date: Fri Apr 26 16:27:24 2013
New Revision: 386676

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=386676
Log:
Clean up memory leak in config file on off nominal paths when glob is allowed

If a system allows for its usage, Asterisk will use glob to help parse
Asterisk .conf files. The config file loading routine was leaking the memory
allocated by the glob() routine when the config file was in an unmodified
or invalid state.

This patch properly calls globfree in those off nominal paths.

(closes issue ASTERISK-21412)
Reported by: Corey Farrell
patches:
  config_glob_leak.patch uploaded by Corey Farrell (license 5909)
........

Merged revisions 386672 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    trunk/   (props changed)
    trunk/main/features.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: trunk/main/features.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/features.c?view=diff&rev=386676&r1=386675&r2=386676
==============================================================================
--- trunk/main/features.c (original)
+++ trunk/main/features.c Fri Apr 26 16:27:24 2013
@@ -9130,6 +9130,7 @@
 /*! \internal \brief Clean up resources on Asterisk shutdown */
 static void features_shutdown(void)
 {
+	ast_cli_unregister_multiple(cli_features, ARRAY_LEN(cli_features));
 	ast_devstate_prov_del("Park");
 	ast_custom_function_unregister(&featuremap_function);
 	ast_custom_function_unregister(&feature_function);
@@ -9142,6 +9143,9 @@
 	ast_unregister_application(app_bridge);
 
 	pthread_cancel(parking_thread);
+	pthread_kill(parking_thread, SIGURG);
+	pthread_join(parking_thread, NULL);
+	ast_context_destroy(NULL, registrar);
 	ao2_ref(parkinglots, -1);
 }
 




More information about the asterisk-commits mailing list