Close file streams in FIPS algorithm test utilities.
authorDr. Stephen Henson <steve@openssl.org>
Thu, 8 Dec 2011 15:14:38 +0000 (15:14 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Thu, 8 Dec 2011 15:14:38 +0000 (15:14 +0000)
fips/dh/fips_dhvs.c
fips/ecdh/fips_ecdhvs.c

index 3ba1977862a9797772eca040a5d6a95305c94be6..0fb52f79a413fe318d5631290e67328c39e9dc74 100644 (file)
@@ -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");
index 61d216d1b7318eebe927b1537a7b710ce88abc75..a1422868b37b69f62ac618a82f02754c3c2145ef 100644 (file)
@@ -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;