From 01a0ed57783a39e6a7b4c18ffa4b2e65154d8008 Mon Sep 17 00:00:00 2001 From: Spencer Wilson Date: Tue, 13 Feb 2024 09:44:49 -0500 Subject: [PATCH] Fix segfault in kat_sig_stfl --- tests/kat_sig_stfl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/kat_sig_stfl.c b/tests/kat_sig_stfl.c index c81e54c00a..9c01539fb1 100644 --- a/tests/kat_sig_stfl.c +++ b/tests/kat_sig_stfl.c @@ -357,7 +357,9 @@ OQS_STATUS sig_stfl_kat(const char *method_name, const char *katfile) { OQS_MEM_insecure_free(msg); OQS_MEM_insecure_free(msg_rand); OQS_SIG_STFL_free(sig); - fclose(fp_rsp); + if (fp_rsp != NULL) { + fclose(fp_rsp); + } return ret; }