diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0828a393a..4834fd8e8 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1190,6 +1190,7 @@ void LP_fromjs_iter() #undef calloc #undef free +#undef clonestr struct LP_memory_list { @@ -1236,4 +1237,10 @@ void LP_free(void *ptr) } //else printf("cJSON_unregister of unknown %p %u\n",item,item->cjsonid); } +char *LP_clonestr(char *str) +{ + char *retstr = LP_alloc(strlen(str)+1); + strcpy(retstr,str); + return(retstr); +} diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index e199b6bfd..f10241da7 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -42,9 +42,11 @@ void PNACL_message(char *arg,...) #define malloc(n) LP_alloc(n) #define calloc(a,b) LP_alloc((uint64_t)(a) * (b)) #define free(ptr) LP_free(ptr) +#define clonestr(str) LP_clonestr(str) void *LP_alloc(uint64_t len); void LP_free(void *ptr); +char *LP_clonestr(char *str); #define MAX(a,b) ((a) > (b) ? (a) : (b)) char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port);