From ac4290d01742ee1228041e7467ed23414ebfbafc Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Mon, 13 Sep 2021 10:10:26 -0600 Subject: cygwin.c: Remove memory leaks These mallocs weren't getting freed. --- cygwin/cygwin.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cygwin') diff --git a/cygwin/cygwin.c b/cygwin/cygwin.c index 58a86c9068..afdb27b315 100644 --- a/cygwin/cygwin.c +++ b/cygwin/cygwin.c @@ -337,6 +337,9 @@ XS(XS_Cygwin_win_to_posix_path) posix_path = (char *) safemalloc(wlen+1); wcsrtombs(posix_path, (const wchar_t **)&wbuf, wlen, NULL); */ + + safefree(wpath); + safefree(wbuf); } else { int what = absolute_flag ? CCP_WIN_A_TO_POSIX : CCP_WIN_A_TO_POSIX | CCP_RELATIVE; posix_path = (char *) safemalloc (len + PATH_LEN_GUESS); @@ -425,6 +428,9 @@ XS(XS_Cygwin_posix_to_win_path) else setlocale(LC_CTYPE, "C"); SETLOCALE_UNLOCK; + + safefree(wpath); + safefree(wbuf); } else { int what = absolute_flag ? CCP_POSIX_TO_WIN_A : CCP_POSIX_TO_WIN_A | CCP_RELATIVE; win_path = (char *) safemalloc(len + PATH_LEN_GUESS); -- cgit v1.2.1