From 1fd2eef1a040537b655828b776d7ef5d39b4bc8e Mon Sep 17 00:00:00 2001 From: zengwei2000 <102871671+zengwei2000@users.noreply.github.com> Date: Wed, 20 Dec 2023 23:42:30 +0800 Subject: [PATCH] fatfs_vfs: fix the Memory leak: work Signed-off-by: zengwei zengwei1@uniontech.com --- pkg/fatfs/fatfs_vfs/fatfs_vfs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/fatfs/fatfs_vfs/fatfs_vfs.c b/pkg/fatfs/fatfs_vfs/fatfs_vfs.c index 97344fd776c9..e96d09bf6d63 100644 --- a/pkg/fatfs/fatfs_vfs/fatfs_vfs.c +++ b/pkg/fatfs/fatfs_vfs/fatfs_vfs.c @@ -90,6 +90,9 @@ static int _format(vfs_mount_t *mountp) /* make sure the volume has been initialized */ if (_init(mountp)) { +#if !CONFIG_FATFS_FORMAT_ALLOC_STATIC + free(work); +#endif return -EINVAL; }