Browse Source

try fix mor memleaks

blackjok3r
blackjok3r 6 years ago
parent
commit
29243e7f55
  1. 12
      iguana/dpow/dpow_fsm.c
  2. 2
      iguana/dpow/dpow_rpc.c
  3. 4
      iguana/dpow/dpow_tx.c
  4. 5
      iguana/iguana_rpc.c

12
iguana/dpow/dpow_fsm.c

@ -669,8 +669,11 @@ void dpow_statemachinestart(void *ptr)
fprintf(stderr, "[%s] Cant find tx.%s rebroadcasting...\n", dp->dest, bits256_str(str,bp->desttxid)); fprintf(stderr, "[%s] Cant find tx.%s rebroadcasting...\n", dp->dest, bits256_str(str,bp->desttxid));
send_dest = 1; send_dest = 1;
} else fprintf(stderr, "[%s] get raw transaction error\n", dp->dest); } else fprintf(stderr, "[%s] get raw transaction error\n", dp->dest);
if ( send_dest == 1 ) if ( send_src == 1 )
dpow_sendrawtransaction(myinfo, bp->destcoin, desttx); {
char *tmpstr = dpow_sendrawtransaction(myinfo, bp->destcoin, desttx);
free(tempstr);
}
} }
// get the confirms for srctxid // get the confirms for srctxid
@ -701,7 +704,10 @@ void dpow_statemachinestart(void *ptr)
send_src = 1; send_src = 1;
} else fprintf(stderr, "[%s] get raw transaction error\n", dp->symbol); } else fprintf(stderr, "[%s] get raw transaction error\n", dp->symbol);
if ( send_src == 1 ) if ( send_src == 1 )
dpow_sendrawtransaction(myinfo, bp->srccoin, srctx); {
char *tmpstr = dpow_sendrawtransaction(myinfo, bp->srccoin, srctx);
free(tempstr);
}
} }
} }
#endif #endif

2
iguana/dpow/dpow_rpc.c

@ -153,6 +153,8 @@ int32_t komodo_initjson2(char *fstr)
{ {
Notaries_elected[i][0] = clonestr(field); Notaries_elected[i][0] = clonestr(field);
Notaries_elected[i][1] = clonestr(hexstr); Notaries_elected[i][1] = clonestr(hexstr);
free(feild);
free(hexstr);
//printf("%d of %d: %s %s\n",i,n,field,hexstr); //printf("%d of %d: %s %s\n",i,n,field,hexstr);
} }
else else

4
iguana/dpow/dpow_tx.c

@ -531,7 +531,9 @@ void dpow_rawtxsign(struct supernet_info *myinfo,struct dpow_info *dp,struct igu
} }
if ( valid != 0 ) if ( valid != 0 )
{ {
printf("bestk.%d %llx %s height.%d mod.%d VINI.%d myind.%d MINE.(%s) j.%d\n",bestk,(long long)bestmask,(src_or_dest != 0) ? bp->destcoin->symbol : bp->srccoin->symbol,bp->height,DPOW_MODIND(bp,0),j,myind,jprint(item,0),j); char *txinfo = jprint(item,0);
printf("bestk.%d %llx %s height.%d mod.%d VINI.%d myind.%d MINE.(%s) j.%d\n",bestk,(long long)bestmask,(src_or_dest != 0) ? bp->destcoin->symbol : bp->srccoin->symbol,bp->height,DPOW_MODIND(bp,0),j,myind,txinfo,j);
free(txinfo);
cp->siglens[bestk] = (int32_t)strlen(sigstr) >> 1; cp->siglens[bestk] = (int32_t)strlen(sigstr) >> 1;
if ( src_or_dest != 0 ) if ( src_or_dest != 0 )
bp->destsigsmasks[bestk] |= (1LL << myind); bp->destsigsmasks[bestk] |= (1LL << myind);

5
iguana/iguana_rpc.c

@ -1302,9 +1302,10 @@ void iguana_rpcloop(void *args)
printf("iguana sent.%d remains.%d of len.%d\n",numsent,remains,recvlen); printf("iguana sent.%d remains.%d of len.%d\n",numsent,remains,recvlen);
} }
} }
if ( retstr != space) //if ( retstr != space)
free(retstr); // free(retstr);
} }
free(retstr);
closesocket(sock); closesocket(sock);
} }
} }

Loading…
Cancel
Save