No need of NULL check before free

Signed-off-by: Maninder Singh <maninder...@samsung.com>
Signed-off-by: Akhilesh Kumar <akhiles...@samsung.com>
---
 tools/top-LTP/proc/alloc.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/top-LTP/proc/alloc.c b/tools/top-LTP/proc/alloc.c
index c8cad61..a06fd71 100644
--- a/tools/top-LTP/proc/alloc.c
+++ b/tools/top-LTP/proc/alloc.c
@@ -12,8 +12,7 @@
 void *xcalloc(void *pointer, int size)
 {
        void *ret;
-       if (pointer)
-               free(pointer);
+       free(pointer);
        if (!(ret = calloc(1, size))) {
                fprintf(stderr, "xcalloc: allocation error, size = %d\n", size);
                exit(1);
-- 
1.7.9.5
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to