aboutsummaryrefslogtreecommitdiff
path: root/crypto/engine/eng_cryptodev.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/engine/eng_cryptodev.c')
-rw-r--r--crypto/engine/eng_cryptodev.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/engine/eng_cryptodev.c b/crypto/engine/eng_cryptodev.c
index 2a2b95ce837e..af59471c4771 100644
--- a/crypto/engine/eng_cryptodev.c
+++ b/crypto/engine/eng_cryptodev.c
@@ -810,14 +810,15 @@ static int cryptodev_digest_update(EVP_MD_CTX *ctx, const void *data,
if (!(ctx->flags & EVP_MD_CTX_FLAG_ONESHOT)) {
/* if application doesn't support one buffer */
- state->mac_data =
+ char *mac_data =
OPENSSL_realloc(state->mac_data, state->mac_len + count);
- if (!state->mac_data) {
+ if (mac_data == NULL) {
printf("cryptodev_digest_update: realloc failed\n");
return (0);
}
+ state->mac_data = mac_data;
memcpy(state->mac_data + state->mac_len, data, count);
state->mac_len += count;