Don't leak memory on Windows in logger

Thanks to 拓真 on Discord for report
This commit is contained in:
def 2021-02-28 23:14:22 +01:00
parent a780dd691d
commit c92f818a3c

View file

@ -177,10 +177,16 @@ static void logger_stdout_sync(const char *line, void *user)
char u16[4] = {0};
if(codepoint < 0)
{
free(wide);
return;
}
if(str_utf16le_encode(u16, codepoint) != 2)
{
free(wide);
return;
}
mem_copy(&wide[wlen], u16, 2);
}