On Thu, 18 Aug 2022 11:51:52 GMT, Matthias Baesken <mbaes...@openjdk.org> wrote:

> There seems to be a case where utf_util.c getWideString might leak memory in 
> an early return.

In case of failing getWideString, we have already a fallback in place that is 
just copying bytes :

    wstr = getWideString(CP_UTF8, (char*)utf8, len, &wlen);
    if ( wstr == NULL ) {
        // Can't allocate WIDE string
        goto just_copy_bytes;
    }

So in these cases it is probably not needed to abort the VM, because fallback 
code exists anyway.
So should we add the free, and replace UTF_ERROR  by something like UTF_WARNING 
(thats just prints the problem - message without abort) ?

-------------

PR: https://git.openjdk.org/jdk/pull/9918

Reply via email to