mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-24 17:06:25 -05:00
Fix leak on error in argutf8
This commit is contained in:
parent
42632f5d45
commit
ebea76c8ed
1 changed files with 3 additions and 1 deletions
|
|
@ -96,8 +96,10 @@ static char* argutf8(const WCHAR* arg)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
res = WideCharToMultiByte(CP_UTF8, 0, arg, len + 1 /* include final null */, utf8_arg, utf8_len, 0, 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 0;
|
||||||
|
}
|
||||||
|
|
||||||
return utf8_arg;
|
return utf8_arg;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue