8354878: File Leak in CgroupSubsystemFactory::determine_type of cgroupSubsystem_linux.cpp:300

Reviewed-by: sgehwolf, jsjolen, dholmes
This commit is contained in:
Casper Norrbin 2025-05-08 16:20:53 +00:00 committed by Severin Gehwolf
parent 6b1e88a946
commit 7f3191a630

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -297,6 +297,7 @@ bool CgroupSubsystemFactory::determine_type(CgroupInfo* cg_infos,
} else {
log_debug(os, container)("Can't read %s, %s", controllers_file, os::strerror(errno));
*flags = INVALID_CGROUPS_V2;
fclose(controllers);
return false;
}
for (int i = 0; i < CG_INFO_LENGTH; i++) {