fix example in docu
authorNils Larsch <nils@openssl.org>
Tue, 5 Apr 2005 11:17:03 +0000 (11:17 +0000)
committerNils Larsch <nils@openssl.org>
Tue, 5 Apr 2005 11:17:03 +0000 (11:17 +0000)
PR: 800

doc/crypto/EVP_EncryptInit.pod

index daf57e5895f1cdb4ed3e0dc15798f697ac995095..40e525dd56ea5bb5e4383cf959aced3b57785ab1 100644 (file)
@@ -479,6 +479,7 @@ General encryption, decryption function example using FILE I/O and RC2 with an
                if(!EVP_CipherUpdate(&ctx, outbuf, &outlen, inbuf, inlen))
                        {
                        /* Error */
                if(!EVP_CipherUpdate(&ctx, outbuf, &outlen, inbuf, inlen))
                        {
                        /* Error */
+                       EVP_CIPHER_CTX_cleanup(&ctx);
                        return 0;
                        }
                fwrite(outbuf, 1, outlen, out);
                        return 0;
                        }
                fwrite(outbuf, 1, outlen, out);
@@ -486,6 +487,7 @@ General encryption, decryption function example using FILE I/O and RC2 with an
        if(!EVP_CipherFinal_ex(&ctx, outbuf, &outlen))
                {
                /* Error */
        if(!EVP_CipherFinal_ex(&ctx, outbuf, &outlen))
                {
                /* Error */
+               EVP_CIPHER_CTX_cleanup(&ctx);
                return 0;
                }
        fwrite(outbuf, 1, outlen, out);
                return 0;
                }
        fwrite(outbuf, 1, outlen, out);