From: Gene Cumm <gene.cumm at gmail.com> COM32/opendir: free for malloc Signed-off-by: Gene Cumm <gene.cumm at gmail.com> --- Matching the malloc with a free. diff --git a/com32/lib/opendir.c b/com32/lib/opendir.c index 7063f8c..5129273 100644 --- a/com32/lib/opendir.c +++ b/com32/lib/opendir.c @@ -50,6 +50,8 @@ DIR *opendir(const char *pathname) /* ENOTDIR is another but a file must exist */ errno = ENOENT; } + if (pathname != tpath) + free(tpath); /* We're done */ return newdir;
Seemingly Similar Threads
- [PATCH 3/5] COM32: Improve opendir() to deal with no '/' at end of string
- [PATCH 1/2] COM32/opendir: remove unneeded zeroing
- [PATCH 1/1] COM32: Add directory functions
- [PATCH 1/1] COM32 API: Add functions for directory use
- [PATCH 3/3] COM32/stat(): preset ret and move zeroing errno