Clean up allocated memory on failure

This commit is contained in:
Andras Fekete
2023-07-10 12:37:07 -04:00
parent 299b4d8552
commit 0a02218ba3

View File

@ -72,6 +72,10 @@ int wc_AriaInitCrypt(wc_Aria* aria, MC_ALGID algo)
}
if (rv != MC_OK) {
if (aria->hSession != NULL) {
MC_CloseSession(aria->hSession);
aria->hSession = NULL;
}
WOLFSSL_MSG(MC_GetErrorString(rv));
return WC_INIT_E;
}