mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Don't leak memory on Windows in logger
Thanks to 拓真 on Discord for report
This commit is contained in:
parent
a780dd691d
commit
c92f818a3c
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue