qemu: Fix memory leaks in qemuDomainSaveImageOpen

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Jiri Denemark 2017-06-06 22:27:57 +02:00
parent ec3e4bb75a
commit ac793bd719

View File

@ -6235,12 +6235,13 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver,
virReportSystemError(errno, virReportSystemError(errno,
_("cannot remove corrupt file: %s"), _("cannot remove corrupt file: %s"),
path); path);
goto error; } else {
fd = -3;
} }
return -3; } else {
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("failed to read qemu header"));
} }
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("failed to read qemu header"));
goto error; goto error;
} }
@ -6255,9 +6256,10 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver,
virReportSystemError(errno, virReportSystemError(errno,
_("cannot remove corrupt file: %s"), _("cannot remove corrupt file: %s"),
path); path);
goto error; } else {
fd = -3;
} }
return -3; goto error;
} }
} }
virReportError(VIR_ERR_OPERATION_FAILED, "%s", msg); virReportError(VIR_ERR_OPERATION_FAILED, "%s", msg);