summaryrefslogtreecommitdiff
path: root/main/astobj2.c
diff options
context:
space:
mode:
authorDavid Vossel <dvossel@digium.com>2010-02-05 04:22:15 +0000
committerDavid Vossel <dvossel@digium.com>2010-02-05 04:22:15 +0000
commita7123b5f4fae9b9be64b666c4716f8c27da7e691 (patch)
tree02c3156ec9f5d7fc8c4d8b0ef677c774a44137aa /main/astobj2.c
parentd5ee95eae633b7832fee5ec67a98c40bceba934b (diff)
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. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@244887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/astobj2.c')
-rw-r--r--main/astobj2.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/main/astobj2.c b/main/astobj2.c
index 5e4cef40a..cbd4511f8 100644
--- a/main/astobj2.c
+++ b/main/astobj2.c
@@ -1099,12 +1099,14 @@ static char *handle_astobj2_test(struct ast_cli_entry *e, int cmd, struct ast_cl
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");