mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
io: fix possible double free of task error object
If a QIOTask has an error set and the calling code uses qio_task_propagate_error() to steal the reference to that Error object, the task would not clear its own reference. This would lead to a double-free when qio_task_free runs, if the caller had (correctly) freed the Error object they now owned. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
c7f1cf01b8
commit
80fb34eda0
2 changed files with 4 additions and 1 deletions
|
@ -157,6 +157,7 @@ bool qio_task_propagate_error(QIOTask *task,
|
|||
{
|
||||
if (task->err) {
|
||||
error_propagate(errp, task->err);
|
||||
task->err = NULL;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue