On VMS, stdout may very well lead to a file that is written to in a
[openssl.git] / apps / passwd.c
index 6c1aed0f0b4910b4163dbce704fe3368bb3c5bc2..6851a9927d310a53d4ef06bbd61eb44a30688377 100644 (file)
@@ -81,6 +81,12 @@ int MAIN(int argc, char **argv)
        if (out == NULL)
                goto err;
        BIO_set_fp(out, stdout, BIO_NOCLOSE | BIO_FP_TEXT);
+#ifdef VMS
+       {
+       BIO *tmpbio = BIO_new(BIO_f_linebuffer());
+       out = BIO_push(tmpbio, out);
+       }
+#endif
 
        badopt = 0, opt_done = 0;
        i = 0;
@@ -276,7 +282,7 @@ err:
        if (in)
                BIO_free(in);
        if (out)
-               BIO_free(out);
+               BIO_free_all(out);
        EXIT(ret);
        }