changeset 47905:4182b3b158e0

8181139: Memory leak in awt_Font.cpp / AwtFont::Create Reviewed-by: serb, ssadetsky
author prr
date Mon, 13 Nov 2017 12:10:49 -0800
parents 26ff2d9a753b
children 845872abef55
files src/java.desktop/windows/native/libawt/windows/awt_Font.cpp
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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);