diff options
author | Mamadou DIOP <bossiel@yahoo.fr> | 2015-12-02 03:26:04 +0100 |
---|---|---|
committer | Mamadou DIOP <bossiel@yahoo.fr> | 2015-12-02 03:26:04 +0100 |
commit | 17900e49f6a29c68b61bf2d0a1cf7384ff1ae4ef (patch) | |
tree | 1e1e80e80d21d85737b4d196975cdce187a3f68c | |
parent | 0e56b468eeaf711e4594aba83a15f2944cfb58b9 (diff) | |
download | doubango-17900e49f6a29c68b61bf2d0a1cf7384ff1ae4ef.zip doubango-17900e49f6a29c68b61bf2d0a1cf7384ff1ae4ef.tar.gz |
Free memory when 0-size is defined for realloc
-rwxr-xr-x | tinySAK/src/tsk_memory.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tinySAK/src/tsk_memory.c b/tinySAK/src/tsk_memory.c index 6e591c2..9d72fc0 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; } |