summaryrefslogtreecommitdiff
path: root/main/manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/manager.c')
-rw-r--r--main/manager.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/main/manager.c b/main/manager.c
index 011ae103e..ba5beb42e 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -7149,7 +7149,7 @@ static char *handle_manager_show_events(struct ast_cli_entry *e, int cmd, struct
static char *handle_manager_show_event(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
- struct ao2_container *events;
+ RAII_VAR(struct ao2_container *, events, NULL, ao2_cleanup);
struct ao2_iterator it_events;
struct ast_xml_doc_item *item, *temp;
int length;
@@ -7184,7 +7184,6 @@ static char *handle_manager_show_event(struct ast_cli_entry *e, int cmd, struct
ao2_ref(item, -1);
}
ao2_iterator_destroy(&it_events);
- ao2_ref(events, -1);
return match;
}
@@ -7194,7 +7193,6 @@ static char *handle_manager_show_event(struct ast_cli_entry *e, int cmd, struct
if (!(item = ao2_find(events, a->argv[3], OBJ_KEY))) {
ast_cli(a->fd, "Could not find event '%s'\n", a->argv[3]);
- ao2_ref(events, -1);
return CLI_SUCCESS;
}
@@ -7234,7 +7232,6 @@ static char *handle_manager_show_event(struct ast_cli_entry *e, int cmd, struct
}
ao2_ref(item, -1);
- ao2_ref(events, -1);
return CLI_SUCCESS;
}