No need to allocate memory for a pointer,
which just used to store getpwnam()'s return.

Signed-off-by: Wei,Jiangang <weijg.f...@cn.fujitsu.com>
---
 testcases/kernel/mem/hugetlb/lib/libipc.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/testcases/kernel/mem/hugetlb/lib/libipc.c 
b/testcases/kernel/mem/hugetlb/lib/libipc.c
index 21fd8da..1f16f22 100644
--- a/testcases/kernel/mem/hugetlb/lib/libipc.c
+++ b/testcases/kernel/mem/hugetlb/lib/libipc.c
@@ -85,10 +85,6 @@ int getuserid(char *user)
 {
        struct passwd *ent;
 
-       ent = malloc(sizeof(struct passwd));
-       if (ent == NULL)
-               tst_brkm(TBROK | TERRNO, cleanup, "malloc ent");
-
        ent = getpwnam(user);
        if (ent == NULL)
                tst_brkm(TBROK | TERRNO, cleanup, "getpwnam");
-- 
1.9.3


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to