summaryrefslogtreecommitdiff
path: root/cygwin
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2021-09-13 10:10:26 -0600
committerYves Orton <demerphq@gmail.com>2023-02-08 15:57:31 +0800
commitac4290d01742ee1228041e7467ed23414ebfbafc (patch)
tree6c449096f6e7ab4f2cd37445cd961da4c14512f5 /cygwin
parent841a3e1bca89544d115c2d2d3df1c96d27172a15 (diff)
downloadperl-ac4290d01742ee1228041e7467ed23414ebfbafc.tar.gz
cygwin.c: Remove memory leaks
These mallocs weren't getting freed.
Diffstat (limited to 'cygwin')
-rw-r--r--cygwin/cygwin.c6
1 files changed, 6 insertions, 0 deletions
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);