mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-25 17:50:45 +00:00
8146317: Memory leak in wcstombsdmp
Reviewed-by: serb, psadhukhan, ssadetsky
This commit is contained in:
parent
d21f33aa5d
commit
0e2ceaee82
@ -221,8 +221,10 @@ wcstombsdmp(wchar_t *wcs, int len)
|
||||
}
|
||||
|
||||
/* TODO: check return values... Handle invalid characters properly... */
|
||||
if (wcstombs(mbs, wcs, n) == (size_t)-1)
|
||||
if (wcstombs(mbs, wcs, n) == (size_t)-1) {
|
||||
free(mbs);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return mbs;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user