summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2011-12-08 15:14:38 +0000
committerDr. Stephen Henson <steve@openssl.org>2011-12-08 15:14:38 +0000
commit7c0d30038f19ce927ac121bd2114e41b8a17ed8e (patch)
tree9fd1fdbfb02b89a474585d964066ed7b30743f09
parent81fc8cd029e2915b1d3d7dfaaaf4d246daa3a954 (diff)
Close file streams in FIPS algorithm test utilities.
-rw-r--r--fips/dh/fips_dhvs.c4
-rw-r--r--fips/ecdh/fips_ecdhvs.c4
2 files changed, 8 insertions, 0 deletions
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;