mirror of
https://github.com/openharmony/third_party_NuttX.git
synced 2026-07-21 16:15:22 -04:00
fix: memory leak
memory allocated by calloc is never released when error returned Signed-off-by: JinuineLi <lihongjin1@huawei.com> Change-Id: I593bad4a833a225d2f91dc036a23e4fffdc6fd6d
This commit is contained in:
@@ -129,6 +129,7 @@ DIR *opendir(const char *path)
|
||||
}
|
||||
if (ret < 0)
|
||||
{
|
||||
free(dir);
|
||||
goto errout_with_count;
|
||||
}
|
||||
dir->fd_status = DIRENT_MAGIC;
|
||||
|
||||
Reference in New Issue
Block a user