1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-26 14:03:49 +03:00

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 <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2013-09-24 16:24:06 +01:00
parent e7b7a2019d
commit d7e9f9f7e8

View File

@ -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;
}
}