From: Joshua Colp Date: Tue, 26 Apr 2016 10:48:40 +0000 (-0300) Subject: app_queue: Fix crash when unloading module. X-Git-Tag: certified/13.1-cert7~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5baf8152931de20164cad324e026cb71a16abdc2;p=thirdparty%2Fasterisk.git app_queue: Fix crash when unloading module. When unloading the app_queue module the members in each queue are destroyed and as part of this they are removed from the pending members container. Unfortunately a crash would occur as the container was destroyed before the members were removed. This change tweaks ordering so the container destruction occurs after the members are destroyed. ASTERISK-16115 Change-Id: I48c728668c55aee3d05b751a5d450fb57e87f44b --- diff --git a/apps/app_queue.c b/apps/app_queue.c index 972ca9f6f8..e490278328 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -10704,8 +10704,9 @@ static int unload_module(void) ast_extension_state_del(0, extension_state_cb); ast_unload_realtime("queue_members"); - ao2_cleanup(pending_members); ao2_cleanup(queues); + ao2_cleanup(pending_members); + queues = NULL; return 0; }