[newlib-cygwin] cygutils: Fix resource leak in get_short_paths

Corinna Vinschen corinna@sourceware.org
Thu Nov 24 15:10:00 GMT 2016


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=584c6643fea45b83a1ef258d9ab1c2ec491b3387

commit 584c6643fea45b83a1ef258d9ab1c2ec491b3387
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Thu Nov 24 16:04:42 2016 +0100

    cygutils: Fix resource leak in get_short_paths
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/utils/cygpath.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/winsup/utils/cygpath.cc b/winsup/utils/cygpath.cc
index 6ab98cd..ccae98f 100644
--- a/winsup/utils/cygpath.cc
+++ b/winsup/utils/cygpath.cc
@@ -414,6 +414,7 @@ get_short_paths (char *path)
       exit (1);
     }
   my_wcstombs (ptr, sbuf, len);
+  free (sbuf);
   return ptr;
 }



More information about the Cygwin-cvs mailing list