mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 10:33:13 +00:00
ast_framehook_detach() must be called with the channel locked.
The framehook container could become corrupted if the channel lock is not held before calling. Change-Id: If0a1c7ba0484ed3a191106a7516526b905952584
This commit is contained in:
@@ -4509,7 +4509,9 @@ static int acf_faxopt_write(struct ast_channel *chan, const char *cmd, char *dat
|
|||||||
ast_log(LOG_WARNING, "Attempt to attach a T.38 gateway on channel (%s) with gateway already running.\n", ast_channel_name(chan));
|
ast_log(LOG_WARNING, "Attempt to attach a T.38 gateway on channel (%s) with gateway already running.\n", ast_channel_name(chan));
|
||||||
}
|
}
|
||||||
} else if (ast_false(val)) {
|
} else if (ast_false(val)) {
|
||||||
|
ast_channel_lock(chan);
|
||||||
ast_framehook_detach(chan, details->gateway_id);
|
ast_framehook_detach(chan, details->gateway_id);
|
||||||
|
ast_channel_unlock(chan);
|
||||||
details->gateway_id = -1;
|
details->gateway_id = -1;
|
||||||
} else {
|
} else {
|
||||||
ast_log(LOG_WARNING, "Unsupported value '%s' passed to FAXOPT(%s).\n", value, data);
|
ast_log(LOG_WARNING, "Unsupported value '%s' passed to FAXOPT(%s).\n", value, data);
|
||||||
@@ -4561,7 +4563,9 @@ static int acf_faxopt_write(struct ast_channel *chan, const char *cmd, char *dat
|
|||||||
ast_log(LOG_WARNING, "Attempt to attach a FAX detect on channel (%s) with FAX detect already running.\n", ast_channel_name(chan));
|
ast_log(LOG_WARNING, "Attempt to attach a FAX detect on channel (%s) with FAX detect already running.\n", ast_channel_name(chan));
|
||||||
}
|
}
|
||||||
} else if (ast_false(val)) {
|
} else if (ast_false(val)) {
|
||||||
|
ast_channel_lock(chan);
|
||||||
ast_framehook_detach(chan, details->faxdetect_id);
|
ast_framehook_detach(chan, details->faxdetect_id);
|
||||||
|
ast_channel_unlock(chan);
|
||||||
details->faxdetect_id = -1;
|
details->faxdetect_id = -1;
|
||||||
} else {
|
} else {
|
||||||
ast_log(LOG_WARNING, "Unsupported value '%s' passed to FAXOPT(%s).\n", value, data);
|
ast_log(LOG_WARNING, "Unsupported value '%s' passed to FAXOPT(%s).\n", value, data);
|
||||||
|
@@ -641,7 +641,9 @@ static void refer_blind_callback(struct ast_channel *chan, struct transfer_chann
|
|||||||
refer_progress_notify(notification);
|
refer_progress_notify(notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ast_channel_lock(chan);
|
||||||
ast_framehook_detach(chan, refer->progress->framehook);
|
ast_framehook_detach(chan, refer->progress->framehook);
|
||||||
|
ast_channel_unlock(chan);
|
||||||
|
|
||||||
ao2_cleanup(refer->progress);
|
ao2_cleanup(refer->progress);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user