Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fabric walletDeinit wallet_ptr free failed #1335

Open
Cavalierliu opened this issue Dec 26, 2022 · 0 comments
Open

fabric walletDeinit wallet_ptr free failed #1335

Cavalierliu opened this issue Dec 26, 2022 · 0 comments
Labels
bug Something isn't working Priority/P1 High priority. Features that will be implemented in the latest or next major/minor version. Severity/major Important features.

Comments

@Cavalierliu
Copy link
Contributor

void BoatHlfabricWalletDeInit(BoatHlfabricWallet *wallet_ptr)
{
// BUINT16 i, j, k;

if (NULL == wallet_ptr)
{
	BoatLog(BOAT_LOG_CRITICAL, "wallet_ptr needn't DeInit: wallet_ptr is NULL.");
	return;
}

/* account_info DeInit */
if (wallet_ptr->account_info.prikeyCtx.keypair_name != NULL)
{
	BoatFree(wallet_ptr->account_info.prikeyCtx.keypair_name);
	wallet_ptr->account_info.prikeyCtx.keypair_name = NULL;
}

/* tlsClinet_info DeInit */

#if (BOAT_HLFABRIC_TLS_SUPPORT == 1)
// for c99, free(NULL) will return directly, so here
// use BOAT_HLFABRIC_ROOTCA_MAX_NUM as cyclic maximum is acceptable.
if (wallet_ptr->tlsCAchain.ca.field_ptr != NULL)
{
BoatFree(wallet_ptr->tlsCAchain.ca.field_ptr);
}
wallet_ptr->tlsCAchain.ca.field_len = 0;
#endif /* #if (BOAT_HLFABRIC_TLS_SUPPORT == 1) */

/* network_info DeInit */

BoATHlfabric_FreeNetworkData(wallet_ptr->network_info);

/* http2Context DeInit */
http2DeInit(wallet_ptr->http2Context_ptr);

/* wallet_ptr DeInit */
BoatFree(wallet_ptr);

/* set NULL after free completed */
wallet_ptr = NULL;

}

@Cavalierliu Cavalierliu added bug Something isn't working Severity/major Important features. Priority/P1 High priority. Features that will be implemented in the latest or next major/minor version. labels Dec 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Priority/P1 High priority. Features that will be implemented in the latest or next major/minor version. Severity/major Important features.
Projects
None yet
Development

No branches or pull requests

1 participant