diff options
author | Saúl Ibarra Corretgé <s@saghul.net> | 2025-01-24 09:59:55 +0100 |
---|---|---|
committer | Saúl Ibarra Corretgé <s@saghul.net> | 2025-01-24 11:46:16 +0100 |
commit | f15c602bd048a42be17281bf0f0d0ec9d6015ca0 (patch) | |
tree | 2c1e1057582d2c665e073ed98f381b97b0889b87 /src | |
parent | 0f31978c303b76798ff2b72e9498e5520722ef8a (diff) | |
download | libuv-f15c602bd048a42be17281bf0f0d0ec9d6015ca0.tar.gz libuv-f15c602bd048a42be17281bf0f0d0ec9d6015ca0.zip |
win: fix leak in uv_os_tmpdir
Fixes: https://github.com/libuv/libuv/issues/4680
Diffstat (limited to 'src')
-rw-r--r-- | src/win/util.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/win/util.c b/src/win/util.c index 1d1b2837..57061bf8 100644 --- a/src/win/util.c +++ b/src/win/util.c @@ -1016,6 +1016,7 @@ int uv_os_homedir(char* buffer, size_t* size) { int uv_os_tmpdir(char* buffer, size_t* size) { + int r; wchar_t *path; size_t len; @@ -1054,7 +1055,9 @@ int uv_os_tmpdir(char* buffer, size_t* size) { path[len] = L'\0'; } - return uv__copy_utf16_to_utf8(path, len, buffer, size); + r = uv__copy_utf16_to_utf8(path, len, buffer, size); + uv__free(path); + return r; } |