win: fix leak in uv_os_tmpdir
Fixes: https://github.com/libuv/libuv/issues/4680
This commit is contained in:
parent
0f31978c30
commit
f15c602bd0
@ -1016,6 +1016,7 @@ int uv_os_homedir(char* buffer, size_t* size) {
|
|||||||
|
|
||||||
|
|
||||||
int uv_os_tmpdir(char* buffer, size_t* size) {
|
int uv_os_tmpdir(char* buffer, size_t* size) {
|
||||||
|
int r;
|
||||||
wchar_t *path;
|
wchar_t *path;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
@ -1054,7 +1055,9 @@ int uv_os_tmpdir(char* buffer, size_t* size) {
|
|||||||
path[len] = L'\0';
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user