diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/abstract_jb.c | 4 | ||||
-rw-r--r-- | main/channel.c | 9 |
2 files changed, 5 insertions, 8 deletions
diff --git a/main/abstract_jb.c b/main/abstract_jb.c index 85c188e88..e4c3c76ed 100644 --- a/main/abstract_jb.c +++ b/main/abstract_jb.c @@ -1055,6 +1055,7 @@ void ast_jb_create_framehook(struct ast_channel *chan, struct ast_jb_conf *jb_co id = datastore->data; ast_framehook_detach(chan, *id); ast_channel_datastore_remove(chan, datastore); + ast_datastore_free(datastore); } ast_channel_unlock(chan); return; @@ -1087,6 +1088,7 @@ void ast_jb_create_framehook(struct ast_channel *chan, struct ast_jb_conf *jb_co id = datastore->data; ast_framehook_detach(chan, *id); ast_channel_datastore_remove(chan, datastore); + ast_datastore_free(datastore); } if (!(datastore = ast_datastore_alloc(&jb_datastore, NULL))) { @@ -1112,6 +1114,4 @@ void ast_jb_create_framehook(struct ast_channel *chan, struct ast_jb_conf *jb_co framedata = NULL; } ast_channel_unlock(chan); - - return; } diff --git a/main/channel.c b/main/channel.c index 4ce4e916f..6a252a699 100644 --- a/main/channel.c +++ b/main/channel.c @@ -10415,10 +10415,7 @@ int ast_channel_suppress(struct ast_channel *chan, unsigned int direction, enum if ((datastore = ast_channel_datastore_find(chan, datastore_info, NULL))) { suppress = datastore->data; - ao2_ref(suppress, +1); - suppress->direction |= direction; - return 0; } @@ -10450,13 +10447,12 @@ int ast_channel_suppress(struct ast_channel *chan, unsigned int direction, enum return -1; } + /* and another ref for the datastore */ + ao2_ref(suppress, +1); datastore->data = suppress; ast_channel_datastore_add(chan, datastore); - /* and another ref for the datastore */ - ao2_ref(suppress, +1); - return 0; } @@ -10484,6 +10480,7 @@ int ast_channel_unsuppress(struct ast_channel *chan, unsigned int direction, enu /* Nothing left to suppress. Bye! */ ast_framehook_detach(chan, suppress->framehook_id); ast_channel_datastore_remove(chan, datastore); + ast_datastore_free(datastore); } return 0; |