-
Bug
-
Resolution: Fixed
-
P3
-
11, 12
-
RHEL7 x86_64 with Japanese Input Method
-
b17
-
generic
-
linux, aix
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8232659 | 11.0.6-oracle | Ichiroh Takiguchi | P3 | Resolved | Fixed | b02 |
JDK-8220284 | 11.0.4 | Ichiroh Takiguchi | P3 | Resolved | Fixed | b01 |
Memory leak issue on awt_InputMethod.c.
See src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c.
On line 1117, memory area was allocated by malloc(), but free() is missing
===========================================
1099 if (text->feedback != NULL) {
1100 int cnt;
1101 jint *tmpstyle;
1102
1103 style = (*env)->NewIntArray(env, text->length);
1104 if (JNU_IsNull(env, style)) {
1105 (*env)->ExceptionClear(env);
1106 THROW_OUT_OF_MEMORY_ERROR();
1107 goto finally;
1108 }
1109
1110 if (sizeof(XIMFeedback) == sizeof(jint)) {
1111 /*
1112 * Optimization to avoid copying the array
1113 */
1114 (*env)->SetIntArrayRegion(env, style, 0,
1115 text->length, (jint *)text->feedback);
1116 } else {
1117 tmpstyle = (jint *)malloc(sizeof(jint)*(text->length));
1118 if (tmpstyle == (jint *) NULL) {
1119 THROW_OUT_OF_MEMORY_ERROR();
1120 goto finally;
1121 }
1122 for (cnt = 0; cnt < (int)text->length; cnt++)
1123 tmpstyle[cnt] = text->feedback[cnt];
1124 (*env)->SetIntArrayRegion(env, style, 0,
1125 text->length, (jint *)tmpstyle);
1126 }
1127 }
===========================================
RFR:
http://mail.openjdk.java.net/pipermail/awt-dev/2018-October/014390.html
Reviewers
http://mail.openjdk.java.net/pipermail/awt-dev/2018-October/014391.html
http://mail.openjdk.java.net/pipermail/awt-dev/2018-October/014415.html
See src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c.
On line 1117, memory area was allocated by malloc(), but free() is missing
===========================================
1099 if (text->feedback != NULL) {
1100 int cnt;
1101 jint *tmpstyle;
1102
1103 style = (*env)->NewIntArray(env, text->length);
1104 if (JNU_IsNull(env, style)) {
1105 (*env)->ExceptionClear(env);
1106 THROW_OUT_OF_MEMORY_ERROR();
1107 goto finally;
1108 }
1109
1110 if (sizeof(XIMFeedback) == sizeof(jint)) {
1111 /*
1112 * Optimization to avoid copying the array
1113 */
1114 (*env)->SetIntArrayRegion(env, style, 0,
1115 text->length, (jint *)text->feedback);
1116 } else {
1117 tmpstyle = (jint *)malloc(sizeof(jint)*(text->length));
1118 if (tmpstyle == (jint *) NULL) {
1119 THROW_OUT_OF_MEMORY_ERROR();
1120 goto finally;
1121 }
1122 for (cnt = 0; cnt < (int)text->length; cnt++)
1123 tmpstyle[cnt] = text->feedback[cnt];
1124 (*env)->SetIntArrayRegion(env, style, 0,
1125 text->length, (jint *)tmpstyle);
1126 }
1127 }
===========================================
RFR:
http://mail.openjdk.java.net/pipermail/awt-dev/2018-October/014390.html
Reviewers
http://mail.openjdk.java.net/pipermail/awt-dev/2018-October/014391.html
http://mail.openjdk.java.net/pipermail/awt-dev/2018-October/014415.html
- backported by
-
JDK-8220284 Memory leak issue on awt_InputMethod.c
-
- Resolved
-
-
JDK-8232659 Memory leak issue on awt_InputMethod.c
-
- Resolved
-