Bug
- Resolution: Fixed
P4
- 17
- b21
- generic
- generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8278464 | 11.0.15-oracle | Poonam Bajaj Parhar | P4 | Resolved | Fixed | b01 |
JDK-8278839 | 11.0.15 | Goetz Lindenmaier | P4 | Resolved | Fixed | b01 |
JDK-8287240 | openjdk8u342 | Zhengyu Gu | P4 | Resolved | Fixed | b04 |
JDK-8354734 | shenandoah8u342 | Zhengyu Gu | P4 | Resolved | Fixed | b04 |
JDK-8278572 | 8u331 | Poonam Bajaj Parhar | P4 | Resolved | Fixed | b01 |
In this code:
936 } else {
937 char* resolved;
938
939 if (!haveBasePath) {
940 if (JDK_Canonicalize((char*)jarfile, canonicalPath, sizeof(canonicalPath)) != 0) {
941 fprintf(stderr, "WARNING: unable to canonicalize %s\n", jarfile);
942 free(path);
943 continue;
944 }
945 parent = basePath(canonicalPath);
946 jplis_assert(parent != (char*)NULL);
947 haveBasePath = 1;
948 }
949
950 resolved = resolve(parent, path); // malloc resolved here
951 jvmtierr = (*jvmtienv)->AddToBootstrapClassLoaderSearch(jvmtienv, resolved); // use resolved here
952 }
Here, we malloc() resolved in line 950 without free(). It is a memory leak, so let's fix it.
936 } else {
937 char* resolved;
938
939 if (!haveBasePath) {
940 if (JDK_Canonicalize((char*)jarfile, canonicalPath, sizeof(canonicalPath)) != 0) {
941 fprintf(stderr, "WARNING: unable to canonicalize %s\n", jarfile);
942 free(path);
943 continue;
944 }
945 parent = basePath(canonicalPath);
946 jplis_assert(parent != (char*)NULL);
947 haveBasePath = 1;
948 }
949
950 resolved = resolve(parent, path); // malloc resolved here
951 jvmtierr = (*jvmtienv)->AddToBootstrapClassLoaderSearch(jvmtienv, resolved); // use resolved here
952 }
Here, we malloc() resolved in line 950 without free(). It is a memory leak, so let's fix it.
- backported by
JDK-8278464Memory leak in appendBootClassPath()
- Resolved
JDK-8278572Memory leak in appendBootClassPath()
- Resolved
JDK-8278839Memory leak in appendBootClassPath()
- Resolved
JDK-8287240Memory leak in appendBootClassPath()
- Resolved
JDK-8354734Memory leak in appendBootClassPath()
- Resolved
- relates to
JDK-8273575memory leak in appendBootClassPath(), paths must be deallocated
- Resolved
- links to
Commitopenjdk/jdk8u-dev/d35dea79
Commitopenjdk/jdk11u-dev/ba1a0e87
Commitopenjdk/jdk/aa90df6f
Reviewopenjdk/jdk8u-dev/42
Reviewopenjdk/jdk11u-dev/713
Reviewopenjdk/jdk/3751
(1 relates to, 6 links to)