[syslinux] [PATCH 1/1] COM32/opendir: free for malloc

Gene Cumm
Thu, 05 Mar 2009 01:33:20 -0000

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;