mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 10:47:28 +02:00
Fix resource leak in wolfSSL_BN_hex2bn
This commit is contained in:
@ -22184,8 +22184,10 @@ int wolfSSL_BN_hex2bn(WOLFSSL_BIGNUM** bn, const char* str)
|
|||||||
|
|
||||||
if (*bn == NULL)
|
if (*bn == NULL)
|
||||||
WOLFSSL_MSG("BN new failed");
|
WOLFSSL_MSG("BN new failed");
|
||||||
else if (wolfSSL_BN_bin2bn(decoded, decSz, *bn) == NULL)
|
else if (wolfSSL_BN_bin2bn(decoded, decSz, *bn) == NULL) {
|
||||||
WOLFSSL_MSG("Bad bin2bn error");
|
WOLFSSL_MSG("Bad bin2bn error");
|
||||||
|
wolfSSL_BN_free(*bn); /* Free new BN */
|
||||||
|
}
|
||||||
else
|
else
|
||||||
ret = WOLFSSL_SUCCESS;
|
ret = WOLFSSL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user