Skip to content

Commit

Permalink
Merge pull request #8268 from bandi13/fixMemleak
Browse files Browse the repository at this point in the history
Fix memory leak
  • Loading branch information
douzzer authored Dec 11, 2024
2 parents d825b08 + ff66998 commit 1f1e985
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 1f1e985

Please sign in to comment.