From 99c0810a573bfaa8af9767e8165e58950ef8e7ef Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 May 2016 22:28:21 -0500 Subject: [PATCH] test --- basilisk/basilisk.c | 6 +++--- basilisk/basilisk_bitcoin.c | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/basilisk/basilisk.c b/basilisk/basilisk.c index ec77bab92..11a523405 100755 --- a/basilisk/basilisk.c +++ b/basilisk/basilisk.c @@ -31,7 +31,7 @@ char *basilisk_finish(struct basilisk_item *ptr,cJSON **argjsonp,int32_t besti) { retstr = ptr->results[i]; if ( argjsonp != 0 ) - *argjsonp = ptr->resultargs[i]; + *argjsonp = jduplicate(ptr->resultargs[i]); } ptr->results[i] = 0; ptr->resultargs[i] = 0; @@ -70,7 +70,7 @@ cJSON *basilisk_resultsjson(struct supernet_info *myinfo,char *symbol,char *remo jaddstr(hexjson,"method","result"); jaddstr(hexjson,"hexmsg",retstr); if ( args != 0 ) - jadd(hexjson,"args",args); + jadd(hexjson,"args",jduplicate(args)); retjson = basilisk_json(myinfo,hexjson,basilisktag,timeoutmillis); free_json(hexjson); } @@ -79,7 +79,7 @@ cJSON *basilisk_resultsjson(struct supernet_info *myinfo,char *symbol,char *remo retjson = cJSON_CreateObject(); jaddstr(retjson,"result",retstr); if ( args != 0 ) - jadd(retjson,"args",args); + jadd(retjson,"args",jduplicate(args)); } return(retjson); } diff --git a/basilisk/basilisk_bitcoin.c b/basilisk/basilisk_bitcoin.c index d6cd3f6f0..2d17e2d69 100755 --- a/basilisk/basilisk_bitcoin.c +++ b/basilisk/basilisk_bitcoin.c @@ -592,7 +592,9 @@ char *basilisk_bitcoinrawtx(struct supernet_info *myinfo,struct iguana_info *coi } } if ( txobj != 0 ) - free_json(txobj); + free_json(txobj), txobj = 0; + if ( *vinsp != 0 ) + free_json(*vinsp), *vinsp = 0; if ( addresses != 0 ) { hexjson = cJSON_CreateObject();