diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index de86660f4..f15df7e9a 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -84,7 +84,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r if ( laststr != 0 ) free(laststr); laststr = newstr; - retstr = laststr; + retstr = clonestr(laststr); } } } diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e481b3fc2..2af888e0e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -31,6 +31,7 @@ // unduplicated bugs: // multiple smartaddresses? enable/disable causes? 250 KMD bounty // verify bid volumes +// free_json crash on encrypted message #include #include "LP_include.h" @@ -233,7 +234,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, } } else printf("error (%s) method is %s\n",jsonstr,method); } - if ( jsonstr != 0 ) + if ( jsonstr != 0 && argjson != 0 ) { len = (int32_t)strlen(jsonstr) + 1; if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 )