-
Bug
-
Resolution: Fixed
-
P4
-
17, 18, 19
-
b13
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8284216 | 18.0.2 | Zhengyu Gu | P4 | Resolved | Fixed | b02 |
JDK-8285476 | 17.0.4-oracle | Prasanta Sadhukhan | P4 | Resolved | Fixed | b05 |
JDK-8284215 | 17.0.4 | Zhengyu Gu | P4 | Resolved | Fixed | b01 |
Java_sun_font_FontConfigManager_getFontConfig {
...
cacheDirs = (*FcConfigGetCacheDirs)(NULL);
935 if (cacheDirs != NULL) {
936 while ((cnt < max) && (cacheDir = (*FcStrListNext)(cacheDirs))) {
937 jstr = (*env)->NewStringUTF(env, (const char*)cacheDir);
938 JNU_CHECK_EXCEPTION(env);
939
940 (*env)->SetObjectArrayElement(env, cacheDirArray, cnt++, jstr);
941 (*env)->DeleteLocalRef(env, jstr);
942 }
943 (*FcStrListDone)(cacheDirs);
944 }
...
}
cacheDir is allocated by (*FcConfigGetCacheDirs)(NULL), but inside the while loop, if there is an exception occurred, macro JNU_CHECK_EXCEPTION(env) [1] ; will return without calling (*FcStrListDone)(cacheDirs);, therefore, cacheDir is leaked.
[1] #define JNU_CHECK_EXCEPTION(env) \
do { \
if ((env)->ExceptionCheck()) { \
return; \
} \
} while (0) \
- backported by
-
JDK-8284215 Potential memory leak in sun.font.FontConfigManager.getFontConfig()
-
- Resolved
-
-
JDK-8284216 Potential memory leak in sun.font.FontConfigManager.getFontConfig()
-
- Resolved
-
-
JDK-8285476 Potential memory leak in sun.font.FontConfigManager.getFontConfig()
-
- Resolved
-
- links to
-
Commit openjdk/jdk17u-dev/ac417114
-
Commit openjdk/jdk18u/3ace021e
-
Commit openjdk/jdk/5df2a057
-
Review openjdk/jdk17u-dev/288
-
Review openjdk/jdk18u/56
-
Review openjdk/jdk/7691