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-25 15:49:13 +01:00
parent e7b7a2019d
commit d7e9f9f7e8
+3 -3
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;
}
}