From 1b5bd6e2ea96136ac374203253cf38abd1081653 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 23:04:30 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_nativeDEX.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 91eadb613..b7489c3f3 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1243,13 +1243,19 @@ void LP_free(void *ptr) printf("total %d allocated total %llu\n",n,(long long)total); lasttime = (uint32_t)time(NULL); } - if ( freemp != 0 ) + DL_FOREACH_SAFE(LP_memory_list,mp,tmp) + { + if ( mp == freemp ) + break; + mp = 0; + } + if ( mp != 0 ) { portable_mutex_lock(&LP_cJSONmutex); - DL_DELETE(LP_memory_list,freemp); + DL_DELETE(LP_memory_list,mp); portable_mutex_unlock(&LP_cJSONmutex); - free(freemp); - } //else printf("cJSON_unregister of unknown %p %u\n",item,item->cjsonid); + free(mp); + } // free from source file with #define redirect for alloc that wasnt } char *LP_clonestr(char *str)