mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 02:37:28 +02:00
Clean up allocated memory on failure
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user