Skip to content

Commit 7f3191a

Browse files
caspernorrbinjerboaa
authored andcommitted
8354878: File Leak in CgroupSubsystemFactory::determine_type of cgroupSubsystem_linux.cpp:300
Reviewed-by: sgehwolf, jsjolen, dholmes
1 parent 6b1e88a commit 7f3191a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/hotspot/os/linux/cgroupSubsystem_linux.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -297,6 +297,7 @@ bool CgroupSubsystemFactory::determine_type(CgroupInfo* cg_infos,
297297
} else {
298298
log_debug(os, container)("Can't read %s, %s", controllers_file, os::strerror(errno));
299299
*flags = INVALID_CGROUPS_V2;
300+
fclose(controllers);
300301
return false;
301302
}
302303
for (int i = 0; i < CG_INFO_LENGTH; i++) {

0 commit comments

Comments
 (0)