Merge pull request #8268 from bandi13/fixMemleak

Fix memory leak
This commit is contained in:
Daniel Pouzzner
2024-12-11 16:35:38 -06:00
committed by GitHub

View File

@@ -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;
}
@@ -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;
}