[asterisk-commits] dvossel: trunk r244887 - /trunk/main/astobj2.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Feb 4 22:22:18 CST 2010


Author: dvossel
Date: Thu Feb  4 22:22:15 2010
New Revision: 244887

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=244887
Log:
fixes memory leak in astobj2 test

ao2_iterator_destroy was not being used on the
iterator during the test.  This resulted in the
container never actually being destroyed.

Modified:
    trunk/main/astobj2.c

Modified: trunk/main/astobj2.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/astobj2.c?view=diff&rev=244887&r1=244886&r2=244887
==============================================================================
--- trunk/main/astobj2.c (original)
+++ trunk/main/astobj2.c Thu Feb  4 22:22:15 2010
@@ -1099,12 +1099,14 @@
 				ao2_t_unlink(c1, obj,"test");
 			ao2_t_ref(obj, -1,"test");
 		}
+		ao2_iterator_destroy(&ai);
 		ast_cli(a->fd, "testing iterators again\n");
 		ai = ao2_iterator_init(c1, 0);
 		while ( (obj = ao2_t_iterator_next(&ai,"test")) ) {
 			ast_cli(a->fd, "iterator on <%s>\n", obj);
 			ao2_t_ref(obj, -1,"test");
 		}
+		ao2_iterator_destroy(&ai);
 	}
 	ast_cli(a->fd, "testing callbacks again\n");
 	ao2_t_callback(c1, 0, print_cb, a, "test callback");




More information about the asterisk-commits mailing list