[OpenJDK 2D-Dev] RFR: 8230480: check malloc/calloc results in java.desktop

Phil Race philip.race at oracle.com
Tue Sep 3 16:57:32 UTC 2019


I am not sure about that free you added.
A return of "1" means success. And a caller is then expecting the 
awtImage to be valid.

How did you determine that this was the correct thing to do here ?

-phil.

On 9/3/19 8:40 AM, Baesken, Matthias wrote:
>
> Hello,  please review this small change .
>
> I noticed that  at a few places  in java.desktop  checking 
>  malloc/calloc   return values  is not done.
>
> This should be changed .
>
> Additionally  I  think we miss here a free in an early return, changed 
> it too :
>
> http://cr.openjdk.java.net/~mbaesken/webrevs/8230480.0/src/java.desktop/unix/native/common/awt/X11Color.c.frames.html
>
> 567     if (depth > 12) {
>
> 568         free (awt_data->awtImage);
>
> 569         return 1;
>
> 570     }
>
> Build/webrev :
>
> https://bugs.openjdk.java.net/browse/JDK-8230480
>
> http://cr.openjdk.java.net/~mbaesken/webrevs/8230480.0/
>
> Thanks, Matthias
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/2d-dev/attachments/20190903/25c93f10/attachment.html>


More information about the 2d-dev mailing list