zkey/kms.c: Use correct variable in warnx()

The variable filename was freed inside the loop and then incorrectly
used in the subsequent warnx() call. Replacing it with directory
reflects the indented context and avoids use after free.

Fixes: f25aaf32b8 ("zkey: Add support for key management system plugins")
Reviewed-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Jan Polensky
2025-03-04 15:26:08 +01:00
committed by Jan Höppner
parent 103c9444c9
commit 549c7ef9e7

View File

@@ -745,7 +745,7 @@ static int remove_directory_recursively(const char *directory)
if (rmdir(directory) != 0) {
rc = -errno;
warnx("Failed to remove '%s': %s", filename, strerror(-rc));
warnx("Failed to remove '%s': %s", directory, strerror(-rc));
goto out;
}