diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-01-28 02:55:25 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-02-25 23:47:54 +0100 |
commit | 76562fa19269efb693d952568bccfbb65692dc8d (patch) | |
tree | d01f9880c5eaa8a773fa8723df01d1fd29476c87 /src | |
parent | 9153062095f34ec8dcdc8862da1ab9abfe560e3f (diff) | |
download | rneovim-76562fa19269efb693d952568bccfbb65692dc8d.tar.gz rneovim-76562fa19269efb693d952568bccfbb65692dc8d.tar.bz2 rneovim-76562fa19269efb693d952568bccfbb65692dc8d.zip |
utf16_to_utf8: minor fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/mbyte.c | 3 | ||||
-rw-r--r-- | src/nvim/memory.c | 2 |
2 files changed, 3 insertions, 2 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(); } diff --git a/src/nvim/memory.c b/src/nvim/memory.c index b49b521bc9..0f402611df 100644 --- a/src/nvim/memory.c +++ b/src/nvim/memory.c @@ -109,7 +109,7 @@ void *xmalloc(size_t size) return ret; } -/// free wrapper that returns delegates to the backing memory manager +/// free() wrapper that delegates to the backing memory manager void xfree(void *ptr) { free(ptr); |