From: Richard Mudgett Date: Fri, 27 Sep 2013 21:56:15 +0000 (+0000) Subject: app_cdr and res_parking: Fix some resource leaks. X-Git-Tag: 12.0.0-alpha2~24^2~53 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8a41aa9bf59e2948618661c2989b4cffbb0a8deb;p=thirdparty%2Fasterisk.git app_cdr and res_parking: Fix some resource leaks. * app_cdr left the ResetCDR application registered. * res_parking leaked a ref to config global. (closes issue ASTERISK-22566) Reported by: Corey Farrell Patches: ASTERISK-22566-r2.patch (license #5909) patch uploaded by Corey Farrell git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400020 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_cdr.c b/apps/app_cdr.c index ba7139cf1a..34fd45675b 100644 --- a/apps/app_cdr.c +++ b/apps/app_cdr.c @@ -149,7 +149,9 @@ static int nocdr_exec(struct ast_channel *chan, const char *data) static int unload_module(void) { - return ast_unregister_application(nocdr_app); + ast_unregister_application(nocdr_app); + ast_unregister_application(resetcdr_app); + return 0; } static int load_module(void) diff --git a/res/res_parking.c b/res/res_parking.c index 12893dba2d..211bbf8a80 100644 --- a/res/res_parking.c +++ b/res/res_parking.c @@ -1169,6 +1169,7 @@ static int unload_module(void) ao2_cleanup(parking_lot_container); parking_lot_container = NULL; aco_info_destroy(&cfg_info); + ao2_global_obj_release(globals); return 0; }