On Wed, 28 Sep 2022 17:31:39 GMT, Alisen Chung <[email protected]> wrote:
>> changed return to cleanup in getAllConfigs
>> changed cleanup to loop thru and free all allocated memory adjacent to
>> graphicsConfig pointer
>
> Alisen Chung has updated the pull request incrementally with one additional
> commit since the last revision:
>
> changed loop end condition to ind-1
Marked as reviewed by azvegint (Reviewer).
src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c line 575:
> 573: cleanup:
> 574: if (success != JNI_TRUE) {
> 575: for (int i = 0; i < ind-1; i++) {
New `int i` declaration shadows previously declared `i`, I think it can be
reused.
src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c line 576:
> 574: if (success != JNI_TRUE) {
> 575: for (int i = 0; i < ind-1; i++) {
> 576: if (graphicsConfigs[i] != 0) {
It it fine as it is, but this check can be omitted since `free` is no-op for
null pointer arguments.
-------------
PR: https://git.openjdk.org/jdk/pull/10378