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/ksym.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/top-LTP/proc/ksym.c b/tools/top-LTP/proc/ksym.c
index 19c5f27..559edca 100644
--- a/tools/top-LTP/proc/ksym.c
+++ b/tools/top-LTP/proc/ksym.c
@@ -289,8 +289,7 @@ open_again:
        close(fd);
        return;
 hell:
-       if (buf)
-               free(buf);
+       free(buf);
        *bufp = NULL;
        *roomp = 0;             /* this function will never work again */
        total = 0;
-- 
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