Skip to content

Commit

Permalink
8292214: Memory leak in getAllConfigs of awt_GraphicsEnv.c:386
Browse files Browse the repository at this point in the history
Reviewed-by: azvegint, dnguyen
  • Loading branch information
Alisen Chung authored and Alexander Zvegintsev committed Oct 4, 2022
1 parent 3644e26 commit 1166a8a
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -383,7 +383,7 @@ getAllConfigs (JNIEnv *env, int screen, AwtScreenDataPtr screenDataPtr) {
*/
screenDataPtr->defaultConfig = makeDefaultConfig(env, screen);
if (screenDataPtr->defaultConfig == NULL) {
return;
goto cleanup;
}
}

Expand Down Expand Up @@ -572,6 +572,9 @@ getAllConfigs (JNIEnv *env, int screen, AwtScreenDataPtr screenDataPtr) {

cleanup:
if (success != JNI_TRUE) {
for (i = 0; i < nConfig; i++) {
free(graphicsConfigs[i]);
}
free(graphicsConfigs);
}
if (n8p != 0)
Expand Down

1 comment on commit 1166a8a

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.