Case of failed memory allocation of dev->zone_cap_blocks
doesn't release heap allocated rep
Found by RASU JSC
Fixes: f8410857b7a8(f2fs-tools: zns zone-capacity support)
Signed-off-by: Maxim Korotkov
---
changeset:
- editted description
lib/libf2fs_zoned.c | 1 +
1 file changed, 1 insert
diff --git a/lib/libf2fs_zoned.c b/lib/libf2fs_zoned.c
index 56c97d1..81088af 100644
--- a/lib/libf2fs_zoned.c
+++ b/lib/libf2fs_zoned.c
@@ -293,6 +293,7 @@ int f2fs_check_zones(int j)
dev->zone_cap_blocks = malloc(dev->nr_zones * sizeof(size_t));
if (!dev->zone_cap_blocks) {
+
In error handling cases, exiting a function without releasing memory
Signed-off-by: Maxim Korotkov
---
changelog: removed trailing indent
fsck/dir.c | 10 +++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/fsck/dir.c b/fsck/dir.c
index 4a3eb6e..793fe11 100644
--- a/fsck
The input pointer "parent" was used unsafely
before checking against NULL
Found by RASU JSC with Svace static analyzer
Fixes: 603f8f9d3(sload.f2fs: support loading files into partition directly)
Reviewed-by: Chao Yu
Signed-off-by: Maxim Korotkov
---
changelog: removed trailing in
In error handling cases, the function exited without releasing memory
Signed-off-by: Maxim Korotkov
---
changelog: fixed code review remarks
fsck/dir.c | 10 +++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/fsck/dir.c b/fsck/dir.c
index 4a3eb6e..29c89de 100644
--- a/fsck
In error handling cases, exiting a function without releasing memory
Added tags to clean up resources and return error code
Found by RASU JSC
Signed-off-by: Maxim Korotkov
---
fsck/dir.c | 9 +++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/fsck/dir.c b/fsck/dir.c
index
The input pointer "parent" was used unsafely
before checking against NULL
Found by RASU JSC with Svace static analyzer
Fixes: 603f8f9d3(sload.f2fs: support loading files into partition directly)
Signed-off-by: Maxim Korotkov
---
fsck/dir.c | 14 +-
1 file changed, 9 insert