f2fs-tools: fixed incorrect error handling
PATCH 1/1 f2fs-tools: fixed incorrect error handling
lib/libf2fs_zoned.c +1 -0
@@ -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) { +free (rep);ERR_MSG ("No memory for zone capacity list.\n" );return -ENOMEM ; }
Signature · 8 lines
2.34.1 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
PATCH v2 1/1 f2fs-tools: fixed incorrect error handling
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 <[email protected]>
---
changeset:
- editted description
lib/libf2fs_zoned.c | 1 + 1 file changed, 1 insertion(+)
lib/libf2fs_zoned.c +1 -0
@@ -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) { +free (rep);ERR_MSG ("No memory for zone capacity list.\n" );return -ENOMEM ; }
Signature · 8 lines
2.34.1 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Quoted 5 lines · Maxim Korotkov
Case of failed memory allocation of
dev->zone_cap_blocksdoesn't release heap allocated rep
Found by RASU JSCFixes f8410857b7a8(f2fs-tools: zns zone-capacity support)Signed-off-by Maxim Korotkov <[email protected]>
Reviewed-by Chao Yu <[email protected]>
Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel