mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 12:14:38 +02:00
Fix memory leak
This commit is contained in:
@@ -558,8 +558,10 @@ int wc_AriaDerive(ecc_key* private_key, ecc_key* public_key,
|
|||||||
(ret == WC_NO_ERR_TRACE(CRYPTOCB_UNAVAILABLE)))
|
(ret == WC_NO_ERR_TRACE(CRYPTOCB_UNAVAILABLE)))
|
||||||
ret = wc_AriaFree(&(info->hash.sha256->hSession),NULL);
|
ret = wc_AriaFree(&(info->hash.sha256->hSession),NULL);
|
||||||
}
|
}
|
||||||
if (ret != 0)
|
if (ret != 0) {
|
||||||
|
wc_AriaFree(&(info->hash.sha256->hSession),NULL);
|
||||||
ret = CRYPTOCB_UNAVAILABLE;
|
ret = CRYPTOCB_UNAVAILABLE;
|
||||||
|
}
|
||||||
/* reset devId */
|
/* reset devId */
|
||||||
info->hash.sha256->devId = devIdArg;
|
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);
|
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 */
|
/* reset devId */
|
||||||
info->hash.sha384->devId = devIdArg;
|
info->hash.sha384->devId = devIdArg;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user