aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2010-12-15 21:31:35 +0000
committerseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2010-12-15 21:31:35 +0000
commitac34cd3508796766688fef451ddb35f0ca6dc2e4 (patch)
tree1ea8d6dd8a68f553da2ad566d6d7a55c3daa9454 /main
parentd5c18854e2a3374a56d328e3891f7ef39120ca4f (diff)
Merged revisions 298345 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r298345 | seanbright | 2010-12-15 16:28:29 -0500 (Wed, 15 Dec 2010) | 6 lines Fix reference and container leaks when running 'astobj2 test.' We need to make sure that ao2_iterator_destroy is called once for each time that ao2_iterator_init is called. Also make sure to unref a newly allocated object that we've linked into a container. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@298346 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/astobj2.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/main/astobj2.c b/main/astobj2.c
index a0f6ab34e..784dfb0a9 100644
--- a/main/astobj2.c
+++ b/main/astobj2.c
@@ -1095,12 +1095,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->fd, "test callback");