From d7e9f9f7e834948fe114afd0c49d893f48b6d8cc Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Tue, 24 Sep 2013 16:24:06 +0100 Subject: [PATCH] Avoid leak in qemuParseRBDString on failure of qemuAddRBDHost If qemuAddRBDHost fails due to parsing problems or OOM, then qemuParseRBDString cleanup is skipped causing a memory leak. Signed-off-by: Daniel P. Berrange --- src/qemu/qemu_command.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 1a364acf15..00ca93e8c7 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3404,9 +3404,9 @@ static int qemuParseRBDString(virDomainDiskDefPtr disk) break; } } - if (qemuAddRBDHost(disk, h) < 0) { - return -1; - } + if (qemuAddRBDHost(disk, h) < 0) + goto error; + h = sep; } } -- GitLab