From 17900e49f6a29c68b61bf2d0a1cf7384ff1ae4ef Mon Sep 17 00:00:00 2001 From: Mamadou DIOP Date: Wed, 2 Dec 2015 03:26:04 +0100 Subject: [PATCH] Free memory when 0-size is defined for realloc --- tinySAK/src/tsk_memory.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tinySAK/src/tsk_memory.c b/tinySAK/src/tsk_memory.c index 6e591c28..9d72fc06 100755 --- a/tinySAK/src/tsk_memory.c +++ b/tinySAK/src/tsk_memory.c @@ -86,6 +86,9 @@ void* tsk_realloc (void* ptr, tsk_size_t size) } } } + else if (ptr) { + free(ptr); + } return ret; }