fix(memory leak):
free "wallet_ptr" in BoatHlfabricWalletDeInit()  .
@@ -877,8 +877,18 @@ void BoatHlfabricWalletDeInit(BoatHlfabricWallet *wallet_ptr)
BoatFree(wallet_ptr->network_info.layoutCfg[i].groupCfg[j].endorser[k].nodeUrl);
}
}
+ if(wallet_ptr->network_info.layoutCfg[i].groupCfg[j].endorser != NULL){
+ BoatFree(wallet_ptr->network_info.layoutCfg[i].groupCfg[j].endorser);
+ wallet_ptr->network_info.layoutCfg[i].groupCfg[j].endorser = NULL;
}
}
+ if(wallet_ptr->network_info.layoutCfg[i].groupCfg != NULL){
+ BoatFree(wallet_ptr->network_info.layoutCfg[i].groupCfg);
+ }
+ }
+ if(wallet_ptr->network_info.layoutCfg != NULL){
+ BoatFree(wallet_ptr->network_info.layoutCfg);
+ }
for (i = 0; i < wallet_ptr->network_info.orderCfg.endorserNumber; i++)
{
if (wallet_ptr->network_info.orderCfg.endorser[i].hostName != NULL)
@@ -890,6 +900,9 @@ void BoatHlfabricWalletDeInit(BoatHlfabricWallet *wallet_ptr)
BoatFree(wallet_ptr->network_info.orderCfg.endorser[i].nodeUrl);
}
}
+ if(wallet_ptr->network_info.orderCfg.endorser != NULL){
+ BoatFree(wallet_ptr->network_info.orderCfg.endorser);
+ }
/* http2Context DeInit */
http2DeInit(wallet_ptr->http2Context_ptr);
