summaryrefslogtreecommitdiff
path: root/res/res_pjsip_pubsub.c
diff options
context:
space:
mode:
authorKevin Harwell <kharwell@digium.com>2015-01-23 15:12:41 +0000
committerKevin Harwell <kharwell@digium.com>2015-01-23 15:12:41 +0000
commit630eea087d62c717cae2c42366e8a972b8ff022d (patch)
treeb3883921814f906822443d95c30da5bd46eb9d55 /res/res_pjsip_pubsub.c
parente23f07beb80a76160edec656d6509db5f1a2885a (diff)
Investigate and fix memory leaks in Asterisk
Fixed memory leaks that were found in Asterisk. ASTERISK-24693 #close Reported by: Kevin Harwell Review: https://reviewboard.asterisk.org/r/4347/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@430999 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip_pubsub.c')
-rw-r--r--res/res_pjsip_pubsub.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c
index f143fa015..8f66e2618 100644
--- a/res/res_pjsip_pubsub.c
+++ b/res/res_pjsip_pubsub.c
@@ -949,7 +949,7 @@ static void resource_tree_destroy(struct resource_tree *tree)
static int build_resource_tree(struct ast_sip_endpoint *endpoint, const struct ast_sip_subscription_handler *handler,
const char *resource, struct resource_tree *tree, int has_eventlist_support)
{
- struct resource_list *list;
+ RAII_VAR(struct resource_list *, list, NULL, ao2_cleanup);
struct resources visited;
if (!has_eventlist_support || !(list = retrieve_resource_list(resource, handler->event_name))) {
@@ -975,7 +975,6 @@ static int build_resource_tree(struct ast_sip_endpoint *endpoint, const struct a
build_node_children(endpoint, handler, list, tree->root, &visited);
AST_VECTOR_FREE(&visited);
- ao2_cleanup(list);
if (AST_VECTOR_SIZE(&tree->root->children) > 0) {
return 200;
@@ -3183,7 +3182,6 @@ static int serialized_pubsub_on_client_refresh(void *userdata)
pjsip_evsub_send_request(sub_tree->evsub, tdata);
} else {
pjsip_evsub_terminate(sub_tree->evsub, PJ_TRUE);
- return 0;
}
ao2_cleanup(sub_tree);
return 0;