From: Dr. Stephen Henson Date: Thu, 8 Dec 2011 15:14:38 +0000 (+0000) Subject: Close file streams in FIPS algorithm test utilities. X-Git-Tag: OpenSSL-fips-2_0-rc7~3 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7c0d30038f19ce927ac121bd2114e41b8a17ed8e;p=oweals%2Fopenssl.git Close file streams in FIPS algorithm test utilities. --- diff --git a/fips/dh/fips_dhvs.c b/fips/dh/fips_dhvs.c index 3ba1977862..0fb52f79a4 100644 --- a/fips/dh/fips_dhvs.c +++ b/fips/dh/fips_dhvs.c @@ -279,6 +279,10 @@ int main(int argc, char **argv) rhash, rhashlen); } } + if (in && in != stdin) + fclose(in); + if (out && out != stdout) + fclose(out); return 0; parse_error: fprintf(stderr, "Error Parsing request file\n"); diff --git a/fips/ecdh/fips_ecdhvs.c b/fips/ecdh/fips_ecdhvs.c index 61d216d1b7..a1422868b3 100644 --- a/fips/ecdh/fips_ecdhvs.c +++ b/fips/ecdh/fips_ecdhvs.c @@ -484,6 +484,10 @@ int main(int argc, char **argv) BN_free(cy); if (group) EC_GROUP_free(group); + if (in && in != stdin) + fclose(in); + if (out && out != stdout) + fclose(out); if (rv) fprintf(stderr, "Error Parsing request file\n"); return rv;