exfatprogs/0001-fsck-fix-memory-leak.patch
Pavel Reichl e223325d9c Fix memory leak in fsck
Upstream fix for this is part of d58057bd9b2f4a24b874a69975ea186466937360

So when we rebase to 1.1.4 we should drop this patch.

Fix convscan problem
RESOURCE_LEAK (CWE-772): [#def10] [important]
exfatprogs-1.1.3/fsck/fsck.c:792: alloc_fn: Storage is returned from allocation function "malloc".
exfatprogs-1.1.3/fsck/fsck.c:792: var_assign: Assigning: "boot_sect" = storage returned from "malloc(512UL)".
exfatprogs-1.1.3/fsck/fsck.c:796: noescape: Resource "boot_sect" is not freed or pointed-to in "exfat_read".
exfatprogs-1.1.3/fsck/fsck.c:799: leaked_storage: Variable "boot_sect"

Resolves: rhbz#2077816
Signed-off-by: Pavel Reichl <preichl@redhat.com>
2022-05-10 12:53:29 +02:00

11 lines
340 B
Diff

--- a/fsck/fsck.c 2021-11-17 10:13:55.729267514 +0100
+++ b/fsck/fsck.c 2022-05-10 12:19:36.397415101 +0200
@@ -796,6 +796,7 @@
if (exfat_read(exfat->blk_dev->dev_fd, boot_sect,
sizeof(*boot_sect), 0) != (ssize_t)sizeof(*boot_sect)) {
exfat_err("failed to read Main boot sector\n");
+ free(boot_sect);
return -EIO;
}