[f2fs-dev] [PATCH v2] f2fs-tools: fixed incorrect error handling

2023-11-19 Thread Maxim Korotkov
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

[f2fs-dev] [PATCH] f2fs-tools: fixed incorrect error handling

2023-11-19 Thread Maxim Korotkov
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) { +

[f2fs-dev] [PATCH v3] fsck.f2fs: fix memleak in f2fs_create()

2023-06-05 Thread Maxim Korotkov
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

[f2fs-dev] [PATCH v2] fsck.f2fs: fix potential NULL dereference

2023-06-02 Thread Maxim Korotkov
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

[f2fs-dev] [PATCH v2] fsck.f2fs: fix memleak in f2fs_create()

2023-06-02 Thread Maxim Korotkov
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

[f2fs-dev] [PATCH] fsck.f2fs: fix memleak in f2fs_create()

2023-05-31 Thread Maxim Korotkov
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

[f2fs-dev] [PATCH] fsck.f2fs: fix potential NULL dereference

2023-05-31 Thread Maxim Korotkov
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