Skip to content

Commit 1fd2eef

Browse files
committed
fatfs_vfs: fix the Memory leak: work
Signed-off-by: zengwei [email protected]
1 parent 724e6e0 commit 1fd2eef

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/fatfs/fatfs_vfs/fatfs_vfs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ static int _format(vfs_mount_t *mountp)
9090

9191
/* make sure the volume has been initialized */
9292
if (_init(mountp)) {
93+
#if !CONFIG_FATFS_FORMAT_ALLOC_STATIC
94+
free(work);
95+
#endif
9396
return -EINVAL;
9497
}
9598

0 commit comments

Comments
 (0)