提交 70bd552e 编写于 作者: J John Ferlan

vbox_temp: Resolve Coverity warnings

Clean up code to resolve Coverity RESOURCE_LEAK's from commit id's
'632b9600' and 'b739f807'.
上级 cc6484d4
...@@ -6267,6 +6267,11 @@ vboxSnapshotRedefine(virDomainPtr dom, ...@@ -6267,6 +6267,11 @@ vboxSnapshotRedefine(virDomainPtr dom,
*/ */
parentUuid = virVBoxSnapshotConfHardDiskUuidByLocation(snapshotMachineDesc, parentUuid = virVBoxSnapshotConfHardDiskUuidByLocation(snapshotMachineDesc,
realReadOnlyDisksPath[it]); realReadOnlyDisksPath[it]);
if (parentUuid == NULL) {
VIR_FREE(readWriteDisk);
goto cleanup;
}
if (virVBoxSnapshotConfAddHardDiskToMediaRegistry(readWriteDisk, if (virVBoxSnapshotConfAddHardDiskToMediaRegistry(readWriteDisk,
snapshotMachineDesc->mediaRegistry, snapshotMachineDesc->mediaRegistry,
parentUuid) < 0) { parentUuid) < 0) {
...@@ -8576,14 +8581,17 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnapshotPtr snapshot) ...@@ -8576,14 +8581,17 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnapshotPtr snapshot)
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to get medium uuid, rc=%08x"), _("Unable to get medium uuid, rc=%08x"),
(unsigned)rc); (unsigned)rc);
VIR_FREE(disk);
goto cleanup; goto cleanup;
} }
VBOX_UTF16_TO_UTF8(uuidUtf16, &uuid); VBOX_UTF16_TO_UTF8(uuidUtf16, &uuid);
disk->uuid = uuid; disk->uuid = uuid;
VBOX_UTF16_FREE(uuidUtf16); VBOX_UTF16_FREE(uuidUtf16);
if (VIR_STRDUP(disk->location, newLocationUtf8) < 0) if (VIR_STRDUP(disk->location, newLocationUtf8) < 0) {
VIR_FREE(disk);
goto cleanup; goto cleanup;
}
rc = newMedium->vtbl->GetFormat(newMedium, &formatUtf16); rc = newMedium->vtbl->GetFormat(newMedium, &formatUtf16);
VBOX_UTF16_TO_UTF8(formatUtf16, &format); VBOX_UTF16_TO_UTF8(formatUtf16, &format);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册