mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-09-06 13:41:44 +00:00
kvm tools: Fix possible leak in qcow
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
@@ -279,8 +279,10 @@ static void *qcow1_read_header(int fd)
|
||||
if (!header)
|
||||
return NULL;
|
||||
|
||||
if (pread_in_full(fd, &f_header, sizeof(struct qcow1_header_disk), 0) < 0)
|
||||
if (pread_in_full(fd, &f_header, sizeof(struct qcow1_header_disk), 0) < 0) {
|
||||
free(header);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
be32_to_cpus(&f_header.magic);
|
||||
be32_to_cpus(&f_header.version);
|
||||
|
||||
Reference in New Issue
Block a user