Skip to content

Commit

Permalink
Fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
Andras Fekete committed Dec 9, 2024
1 parent 86b24ef commit ff66998
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions wolfcrypt/src/port/aria/aria-cryptocb.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,10 @@ int wc_AriaDerive(ecc_key* private_key, ecc_key* public_key,
(ret == WC_NO_ERR_TRACE(CRYPTOCB_UNAVAILABLE)))
ret = wc_AriaFree(&(info->hash.sha256->hSession),NULL);
}
if (ret != 0)
if (ret != 0) {
wc_AriaFree(&(info->hash.sha256->hSession),NULL);
ret = CRYPTOCB_UNAVAILABLE;
}
/* reset devId */
info->hash.sha256->devId = devIdArg;
}
Expand Down Expand Up @@ -590,7 +592,10 @@ int wc_AriaDerive(ecc_key* private_key, ecc_key* public_key,
ret = wc_AriaFree(&(info->hash.sha384->hSession),NULL);
}
}
if (ret != 0) ret = CRYPTOCB_UNAVAILABLE;
if (ret != 0) {
wc_AriaFree(&(info->hash.sha384->hSession),NULL);
ret = CRYPTOCB_UNAVAILABLE;
}
/* reset devId */
info->hash.sha384->devId = devIdArg;
}
Expand Down

0 comments on commit ff66998

Please sign in to comment.