8181139: Memory leak in awt_Font.cpp / AwtFont::Create
Reviewed-by: serb, ssadetsky
--- a/src/java.desktop/windows/native/libawt/windows/awt_Font.cpp Fri Nov 10 12:37:02 2017 +0530
+++ b/src/java.desktop/windows/native/libawt/windows/awt_Font.cpp Mon Nov 13 12:10:49 2017 -0800
@@ -283,6 +283,7 @@
// Ask peer class for the text component font name
jstring jTextComponentFontName = GetTextComponentFontName(env, font);
if (jTextComponentFontName == NULL) {
+ delete awtFont;
return NULL;
}
LPCWSTR textComponentFontName = JNU_GetStringPlatformChars(env, jTextComponentFontName, NULL);