diff mbox series

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

Message ID 20231120065507.423065-1-korotkov.maxim.s@gmail.com (mailing list archive)
State Superseded
Headers show
Series [f2fs-dev] f2fs-tools: fixed incorrect error handling | expand

Commit Message

Maxim Korotkov Nov. 20, 2023, 6:55 a.m. UTC

diff mbox series

Patch

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) {
+		free(rep);
 		ERR_MSG("No memory for zone capacity list.\n");
 		return -ENOMEM;
 	}