From 9226e4ed8c282c2d25669646e8802d00321a57dc Mon Sep 17 00:00:00 2001 From: Jordan IMBERT Date: Thu, 17 Dec 2020 10:07:18 +0100 Subject: [PATCH] Remove always true condition in cJSON.c (#539) --- cJSON.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cJSON.c b/cJSON.c index 0f079ae..030311c 100644 --- a/cJSON.c +++ b/cJSON.c @@ -511,10 +511,8 @@ static unsigned char* ensure(printbuffer * const p, size_t needed) return NULL; } - if (newbuffer) - { - memcpy(newbuffer, p->buffer, p->offset + 1); - } + + memcpy(newbuffer, p->buffer, p->offset + 1); p->hooks.deallocate(p->buffer); } p->length = newsize;