Don't free cryptogram in the store_cipher_body to avoid possible double free memory...
authorCryptoManiac <balthazar@yandex.ru>
Mon, 2 May 2016 18:08:55 +0000 (21:08 +0300)
committerCryptoManiac <balthazar@yandex.ru>
Mon, 2 May 2016 18:10:49 +0000 (21:10 +0300)
The cryptogram pointer is already freed in the end of ecies_encrypt function.

src/ecies.cpp

index 101b322..93a8900 100644 (file)
@@ -224,7 +224,6 @@ static int store_cipher_body(
     if (EVP_EncryptFinal_ex(&cipher, body, &out_len) != 1) {
         SET_OSSL_ERROR("Error while finalizing the data using the symmetric cipher");
         EVP_CIPHER_CTX_cleanup(&cipher);
-        cryptogram_free(cryptogram);
         return 0;
     }