--- a/src/java.desktop/unix/native/common/awt/fontpath.c Wed Sep 18 07:18:44 2019 -0700
+++ b/src/java.desktop/unix/native/common/awt/fontpath.c Mon Sep 23 13:08:20 2019 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -898,9 +898,9 @@
locale = (*env)->GetStringUTFChars(env, localeStr, 0);
if ((libfontconfig = openFontConfig()) == NULL) {
- (*env)->ReleaseStringUTFChars (env, fcNameStr, (const char*)fcName);
+ (*env)->ReleaseStringUTFChars(env, fcNameStr, (const char*)fcName);
if (locale) {
- (*env)->ReleaseStringUTFChars (env, localeStr,(const char*)locale);
+ (*env)->ReleaseStringUTFChars(env, localeStr,(const char*)locale);
}
return -1;
}
@@ -929,9 +929,9 @@
FcPatternGetInteger == NULL ||
FcPatternDestroy == NULL) { /* problem with the library: return. */
- (*env)->ReleaseStringUTFChars (env, fcNameStr, (const char*)fcName);
+ (*env)->ReleaseStringUTFChars(env, fcNameStr, (const char*)fcName);
if (locale) {
- (*env)->ReleaseStringUTFChars (env, localeStr,(const char*)locale);
+ (*env)->ReleaseStringUTFChars(env, localeStr,(const char*)locale);
}
closeFontConfig(libfontconfig, JNI_FALSE);
return -1;
@@ -956,9 +956,9 @@
}
(*FcPatternDestroy)(pattern);
- (*env)->ReleaseStringUTFChars (env, fcNameStr, (const char*)fcName);
+ (*env)->ReleaseStringUTFChars(env, fcNameStr, (const char*)fcName);
if (locale) {
- (*env)->ReleaseStringUTFChars (env, localeStr, (const char*)locale);
+ (*env)->ReleaseStringUTFChars(env, localeStr, (const char*)locale);
}
closeFontConfig(libfontconfig, JNI_TRUE);
@@ -1190,6 +1190,9 @@
(*env)->DeleteLocalRef(env, fcNameStr);
if (pattern == NULL) {
closeFontConfig(libfontconfig, JNI_FALSE);
+ if (locale) {
+ (*env)->ReleaseStringUTFChars(env, localeStr, (const char*)locale);
+ }
return;
}
@@ -1207,6 +1210,9 @@
if (fontset == NULL) {
(*FcPatternDestroy)(pattern);
closeFontConfig(libfontconfig, JNI_FALSE);
+ if (locale) {
+ (*env)->ReleaseStringUTFChars(env, localeStr, (const char*)locale);
+ }
return;
}
@@ -1238,6 +1244,9 @@
(*FcPatternDestroy)(pattern);
(*FcFontSetDestroy)(fontset);
closeFontConfig(libfontconfig, JNI_FALSE);
+ if (locale) {
+ (*env)->ReleaseStringUTFChars(env, localeStr, (const char*)locale);
+ }
return;
}
fontCount = 0;
@@ -1280,6 +1289,9 @@
(*FcPatternDestroy)(pattern);
(*FcFontSetDestroy)(fontset);
closeFontConfig(libfontconfig, JNI_FALSE);
+ if (locale) {
+ (*env)->ReleaseStringUTFChars(env, localeStr, (const char*)locale);
+ }
return;
}
@@ -1334,6 +1346,9 @@
(*FcPatternDestroy)(pattern);
(*FcFontSetDestroy)(fontset);
closeFontConfig(libfontconfig, JNI_FALSE);
+ if (locale) {
+ (*env)->ReleaseStringUTFChars(env, localeStr, (const char*)locale);
+ }
return;
}
(*env)->SetObjectField(env,fcCompFontObj, fcAllFontsID, fcFontArr);
@@ -1395,7 +1410,7 @@
/* release resources and close the ".so" */
if (locale) {
- (*env)->ReleaseStringUTFChars (env, localeStr, (const char*)locale);
+ (*env)->ReleaseStringUTFChars(env, localeStr, (const char*)locale);
}
closeFontConfig(libfontconfig, JNI_TRUE);
}