diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-11-30 03:20:42 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-11-30 03:20:42 +0000 |
commit | 0a2070a04d7894b0b09ece1cc14c5b534b232f4f (patch) | |
tree | 69f69c9b6ed841e420f80d208d34d4f428c56940 /channel.c | |
parent | 9357f515dc030660ea91a7b0545444c3fc4baa95 (diff) |
port memory leak fix from rev 7223 in trunk
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@7224 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channel.c')
-rw-r--r-- | channel.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -1016,8 +1016,13 @@ void ast_channel_spy_stop_by_type(struct ast_channel *chan, const char *type) return; AST_LIST_TRAVERSE(&chan->spies->list, spy, list) { - if ((spy->type == type) && (spy->status == CHANSPY_RUNNING)) + ast_mutex_lock(&spy->lock); + if ((spy->type == type) && (spy->status == CHANSPY_RUNNING)) { spy->status = CHANSPY_DONE; + if (ast_test_flag(spy, CHANSPY_TRIGGER_MODE) != CHANSPY_TRIGGER_NONE) + ast_cond_signal(&spy->trigger); + } + ast_mutex_unlock(&spy->lock); } } @@ -3912,8 +3917,10 @@ struct ast_frame *ast_channel_spy_read_frame(struct ast_channel_spy *spy, unsign if (need_dup) result = ast_frdup(read_frame); - else + else { result = read_frame; + ast_frfree(write_frame); + } } else { if (need_dup) { result = ast_frdup(read_frame); |