From 2cc317b1f52a98493cc7b34cf1a2d3a7b9bc292c Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Thu, 9 Feb 2017 10:49:23 +0100 Subject: [PATCH] qemu_blockjob: Avoid dereferencing NULL on OOM Signed-off-by: Jiri Denemark --- src/qemu/qemu_blockjob.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 4ada4cd277..985fae1e96 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -123,7 +123,8 @@ qemuBlockJobEventProcess(virQEMUDriverPtr driver, if ((persistDisk = virDomainDiskByName(vm->newDef, disk->dst, false))) { copy = virStorageSourceCopy(disk->mirror, false); - if (virStorageSourceInitChainElement(copy, + if (!copy || + virStorageSourceInitChainElement(copy, persistDisk->src, true) < 0) { VIR_WARN("Unable to update persistent definition " -- GitLab