From b6366f824ce0e9d0c7c66806170bcf6a10842a4b Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 23:00:48 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_nativeDEX.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index cf18369f2..91eadb613 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1215,11 +1215,15 @@ void *LP_alloc(uint64_t len) void *LP_realloc(void *ptr,uint64_t len) { struct LP_memory_list *mp = ptr; - --mp; - mp = realloc(mp,len + sizeof(*mp)); - mp->timestamp = (uint32_t)time(NULL); - mp->len = (uint32_t)len; - return(&mp[1]); + if ( mp != 0 ) + { + --mp; + printf("\n>>>>>>>>>>> LP_realloc mp.%p ptr.%p len.%llu\n",mp,&mp[1],(long long)len); + mp = realloc(mp,len + sizeof(*mp)); + mp->timestamp = (uint32_t)time(NULL); + mp->len = (uint32_t)len; + return(&mp[1]); + } else return(LP_alloc(len)); } void LP_free(void *ptr)