No need of NULL check before free
Signed-off-by: Maninder Singh <[email protected]>
Signed-off-by: Akhilesh Kumar <[email protected]>
---
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list