]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - apps/enc.c
On VMS, stdout may very well lead to a file that is written to in a
[thirdparty/openssl.git] / apps / enc.c
index 49338aca0fdc7ceeb6f3686589fb8ad59d41299c..2101b4cc647786d57799eb0d380a0e2a68fb1d9a 100644 (file)
@@ -416,7 +416,15 @@ bad:
 
 
        if (outf == 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,outf) <= 0)
@@ -584,7 +592,7 @@ end:
        if (strbuf != NULL) OPENSSL_free(strbuf);
        if (buff != NULL) OPENSSL_free(buff);
        if (in != NULL) BIO_free(in);
-       if (out != NULL) BIO_free(out);
+       if (out != NULL) BIO_free_all(out);
        if (benc != NULL) BIO_free(benc);
        if (b64 != NULL) BIO_free(b64);
        if(pass) OPENSSL_free(pass);