diff options
| author | Pietro Monteiro <pietro@sociotechnical.xyz> | 2026-01-30 07:57:02 -0500 |
|---|---|---|
| committer | Pietro Monteiro <pietro@sociotechnical.xyz> | 2026-01-30 07:57:02 -0500 |
| commit | a2a7c49948ae75324c7fcb92719568a0928d1671 (patch) | |
| tree | bcf7f4bae6ad79968b080c6892f6ae0aad4b8240 /libjava/classpath/resource/gnu/java | |
| parent | 69ee6ac4bca7e01702615e6fb1acb8de9d544683 (diff) | |
| download | gcc-a2a7c49948ae75324c7fcb92719568a0928d1671.zip gcc-a2a7c49948ae75324c7fcb92719568a0928d1671.tar.gz gcc-a2a7c49948ae75324c7fcb92719568a0928d1671.tar.bz2 | |
libga68: Use the internal malloc for UTF-32 to UTF-8 conversion
_libga68_u32_to_u8 called free on the result buffer on error, but the
buffer is allocated by the GC, so calling free on it is incorrect.
Instead of using the GC, use the internal malloc because this is an
internal function.
Remove the resultbuf parameter from the _libga68_u32_to_u8 since all
callers used NULL for it.
Last but not least, return a null-terminated char* from
_libga68_u32_to_u8.
libga68/ChangeLog:
* ga68-alloc.c (_libga68_realloc_internal): New function.
* ga68-posix.c (_libga68_posixperror): Adjust calls to _libga68_u32_to_u8.
(_libga68_posixfopen): Likewise.
(_libga68_posixcreat): Likewise.
(_libga68_posixgetenv): Likewise.
(_libga68_posixfputs): Likewise.
(_libga68_posixfconnect): Likewise.
* ga68-unistr.c (_libga68_u32_to_u8): Use internal allocator.
* ga68.h (_libga68_realloc_internal): New prototype.
(_libga68_u32_to_u8): Update prototype.
Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
Diffstat (limited to 'libjava/classpath/resource/gnu/java')
0 files changed, 0 insertions, 0 deletions
