Skip to content

fabric walletDeinit wallet_ptr free failed #1335

@Cavalierliu

Description

@Cavalierliu

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;

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority/P1High priority. Features that will be implemented in the latest or next major/minor version.Severity/majorImportant features.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions