]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - apps/dh.c
On VMS, stdout may very well lead to a file that is written to in a
[thirdparty/openssl.git] / apps / dh.c
index ee71d95f0c5acfa766835dbd55085e0431b85c2b..7465442e49f1c07f8d766029ca8bdfe599c0eb43 100644 (file)
--- a/apps/dh.c
+++ b/apps/dh.c
@@ -184,7 +184,15 @@ bad:
                        }
                }
        if (outfile == NULL)
+               {
                BIO_set_fp(out,stdout,BIO_NOCLOSE);
+#ifdef VMS
+               {
+               BIO *tmpbio = BIO_new(BIO_f_linebuffer());
+               out = BIO_push(tmpbio, out);
+               }
+#endif
+               }
        else
                {
                if (BIO_write_filename(out,outfile) <= 0)
@@ -309,7 +317,7 @@ bad:
        ret=0;
 end:
        if (in != NULL) BIO_free(in);
-       if (out != NULL) BIO_free(out);
+       if (out != NULL) BIO_free_all(out);
        if (dh != NULL) DH_free(dh);
        EXIT(ret);
        }