From 5aae5b5bb2a2c6f7f004b415466a57942421b8db Mon Sep 17 00:00:00 2001 From: practicalswift Date: Fri, 12 Jan 2018 11:18:25 +0100 Subject: [PATCH] Avoid calling fclose(...) with an invalid argument --- src/tests.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tests.c b/src/tests.c index 580eea74b90ef..c312c5a58991c 100644 --- a/src/tests.c +++ b/src/tests.c @@ -4924,7 +4924,9 @@ int main(int argc, char **argv) { seed16[6] ^= t >> 48; seed16[7] ^= t >> 56; } - fclose(frand); + if (frand) { + fclose(frand); + } } secp256k1_rand_seed(seed16);