mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-09 11:28:25 +00:00
port memory leak fix from rev 7223 in trunk
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@7224 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
11
channel.c
11
channel.c
@@ -1016,8 +1016,13 @@ void ast_channel_spy_stop_by_type(struct ast_channel *chan, const char *type)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
AST_LIST_TRAVERSE(&chan->spies->list, spy, list) {
|
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;
|
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)
|
if (need_dup)
|
||||||
result = ast_frdup(read_frame);
|
result = ast_frdup(read_frame);
|
||||||
else
|
else {
|
||||||
result = read_frame;
|
result = read_frame;
|
||||||
|
ast_frfree(write_frame);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (need_dup) {
|
if (need_dup) {
|
||||||
result = ast_frdup(read_frame);
|
result = ast_frdup(read_frame);
|
||||||
|
|||||||
Reference in New Issue
Block a user