aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mbyte.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-03-01 02:30:05 +0100
committerGitHub <noreply@github.com>2019-03-01 02:30:05 +0100
commite7bd49d835e26c96b2ee152e5b697e20ab749650 (patch)
treeb02e91d42c8b8a8ef578076ae8bf8deef26b94b5 /src/nvim/mbyte.c
parent533d4a36ec03626e9d796ef7e2a9aa3c0e1ce7bf (diff)
parent403922b1b47c1f03272e2bdd600dcc02db481389 (diff)
downloadrneovim-e7bd49d835e26c96b2ee152e5b697e20ab749650.tar.gz
rneovim-e7bd49d835e26c96b2ee152e5b697e20ab749650.tar.bz2
rneovim-e7bd49d835e26c96b2ee152e5b697e20ab749650.zip
Merge #7920 'env: use libuv v1.12 getenv/setenv API'
Diffstat (limited to 'src/nvim/mbyte.c')
-rw-r--r--src/nvim/mbyte.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c
index ead6b4405d..1cf045d7e0 100644
--- a/src/nvim/mbyte.c
+++ b/src/nvim/mbyte.c
@@ -1375,6 +1375,7 @@ int utf8_to_utf16(const char *str, wchar_t **strw)
int utf16_to_utf8(const wchar_t *strw, char **str)
FUNC_ATTR_NONNULL_ALL
{
+ *str = NULL;
// Compute the space required to store the string as UTF-8.
DWORD utf8_len = WideCharToMultiByte(CP_UTF8,
0,
@@ -1400,7 +1401,7 @@ int utf16_to_utf8(const wchar_t *strw, char **str)
NULL,
NULL);
if (utf8_len == 0) {
- free(*str);
+ xfree(*str);
*str = NULL;
return GetLastError();
}