diff --git a/jdk/src/windows/native/sun/windows/awt_Button.cpp b/jdk/src/windows/native/sun/windows/awt_Button.cpp index b62069035c1..672d3540c1d 100644 --- a/jdk/src/windows/native/sun/windows/awt_Button.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Button.cpp @@ -317,7 +317,9 @@ void AwtButton::_SetLabel(void *param) badAlloc = 1; } else { c->SetText(labelStr); - JNU_ReleaseStringPlatformChars(env, label, labelStr); + if (label != NULL) { + JNU_ReleaseStringPlatformChars(env, label, labelStr); + } } } diff --git a/jdk/src/windows/native/sun/windows/awt_Checkbox.cpp b/jdk/src/windows/native/sun/windows/awt_Checkbox.cpp index 21f42bea3dd..362c857b88d 100644 --- a/jdk/src/windows/native/sun/windows/awt_Checkbox.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Checkbox.cpp @@ -384,7 +384,9 @@ void AwtCheckbox::_SetLabel(void *param) { c->SetText(labelStr); c->VerifyState(); - JNU_ReleaseStringPlatformChars(env, label, labelStr); + if (label != NULL) { + JNU_ReleaseStringPlatformChars(env, label, labelStr); + } } }