[asterisk-commits] mmichelson: branch group/CCSS_Monitor_Restructure r243059 - /team/group/CCSS_...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jan 25 17:39:29 CST 2010


Author: mmichelson
Date: Mon Jan 25 17:39:26 2010
New Revision: 243059

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=243059
Log:
Fix memory leaks found during typical operation.

Tomorrow I'll make sure that failure scenarios do not cause
crashes, leaks, and the like. Then I'll move on to SIP testing.


Modified:
    team/group/CCSS_Monitor_Restructure/main/ccss.c

Modified: team/group/CCSS_Monitor_Restructure/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/main/ccss.c?view=diff&rev=243059&r1=243058&r2=243059
==============================================================================
--- team/group/CCSS_Monitor_Restructure/main/ccss.c (original)
+++ team/group/CCSS_Monitor_Restructure/main/ccss.c Mon Jan 25 17:39:26 2010
@@ -1135,6 +1135,8 @@
 
 	ast_log_dynamic_level(cc_logger_level, "Canceling generic monitor available timer for monitor %s\n", monitor->interface->name);
 	ast_sched_thread_del(cc_sched_thread, *sched_id);
+	*sched_id = -1;
+	cc_unref(monitor, "Remove scheduler's reference to the monitor");
 	return 0;
 }
 
@@ -1172,8 +1174,16 @@
 		}
 	}
 	AST_LIST_TRAVERSE_SAFE_END;
+	
+	if (AST_LIST_EMPTY(&generic_list->list)) {
+		/* No more monitors with this device name exist. Time to unlink this
+		 * list from the container
+		 */
+		ao2_t_unlink(generic_monitors, generic_list, "Generic list is empty. Unlink it from the container");
+	}
 	cc_unref(generic_list, "Done with generic list in generic monitor destructor");
 	ast_free((char *)gen_mon_pvt->device_name);
+	ast_free(gen_mon_pvt);
 }
 
 static void cc_interface_destroy(void *data)




More information about the asterisk-commits mailing list