8181139: Memory leak in awt_Font.cpp / AwtFont::Create
authorprr
Mon, 13 Nov 2017 12:10:49 -0800
changeset 47832 4182b3b158e0
parent 47831 26ff2d9a753b
child 47833 845872abef55
8181139: Memory leak in awt_Font.cpp / AwtFont::Create Reviewed-by: serb, ssadetsky
src/java.desktop/windows/native/libawt/windows/awt_Font.cpp
--- 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);