]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
support: Fix FILE * leak in check_for_unshare_hints in test-container
authorFlorian Weimer <fweimer@redhat.com>
Thu, 6 Nov 2025 13:33:22 +0000 (14:33 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Thu, 6 Nov 2025 15:27:51 +0000 (16:27 +0100)
The file opened via fopen is never closed.

support/test-container.c

index ae643d307ec71b5e905e7aa80ef1a46db046762d..f48cdaea688993de273372da7cf34d29bf4a8ede 100644 (file)
@@ -705,6 +705,7 @@ check_for_unshare_hints (int require_pidns)
 
       val = -1; /* Sentinel.  */
       int cnt = fscanf (f, "%d", &val);
+      fclose (f);
       if (cnt == 1 && val != files[i].bad_value)
        continue;