Commit dd834749 authored by Erik de Castro Lopo's avatar Erik de Castro Lopo
Browse files

share/utf8: Add missing check

Patch-from: lvqcl <lvqcl.mail@gmail.com>
parent 7be5df6c
......@@ -182,6 +182,12 @@ int utf8_encode(const char *from, char **to)
* MS doesn't actually have a consistent API across win32.
*/
*to = (char*)make_utf8_string(unicode);
if(*to == NULL)
{
free(unicode);
fprintf(stderr, "Out of memory processing string from UNICODE16 to UTF8\n");
return -1;
}
free(unicode);
return 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment