8296347: Memory leak from ClassPathDirEntry::_dir

Co-authored-by: Justin King <jcking@google.com>
Reviewed-by: dholmes, ccheung
This commit is contained in:
Man Cao 2022-11-08 23:34:45 +00:00
parent 671f84bd86
commit 8146e1af82
2 changed files with 5 additions and 1 deletions

View file

@ -237,6 +237,10 @@ const char* ClassPathEntry::copy_path(const char* path) {
return copy;
}
ClassPathDirEntry::~ClassPathDirEntry() {
FREE_C_HEAP_ARRAY(char, _dir);
}
ClassFileStream* ClassPathDirEntry::open_stream(JavaThread* current, const char* name) {
// construct full path name
assert((_dir != NULL) && (name != NULL), "sanity");