mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Fix leak on error in argutf8
This commit is contained in:
parent
b017cd53d6
commit
617ebf6554
1 changed files with 3 additions and 1 deletions
|
|
@ -96,8 +96,10 @@ static char* argutf8(const WCHAR* arg)
|
|||
return 0;
|
||||
|
||||
res = WideCharToMultiByte(CP_UTF8, 0, arg, len + 1 /* include final null */, utf8_arg, utf8_len, 0, 0);
|
||||
if (res != utf8_len)
|
||||
if (res != utf8_len) {
|
||||
free(utf8_arg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return utf8_arg;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue