It requests to declare a pointer to for getpwnam() returns, not to allocate memory for it. This patch does the same as 2c0c4b3.
Signed-off-by: Wei,Jiangang <weijg.f...@cn.fujitsu.com> --- testcases/kernel/mem/hugetlb/lib/libipc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/testcases/kernel/mem/hugetlb/lib/libipc.c b/testcases/kernel/mem/hugetlb/lib/libipc.c index 21fd8da..cfcde6b 100644 --- a/testcases/kernel/mem/hugetlb/lib/libipc.c +++ b/testcases/kernel/mem/hugetlb/lib/libipc.c @@ -83,11 +83,7 @@ int getipckey(void) */ int getuserid(char *user) { - struct passwd *ent; - - ent = malloc(sizeof(struct passwd)); - if (ent == NULL) - tst_brkm(TBROK | TERRNO, cleanup, "malloc ent"); + struct passwd *ent = NULL; ent = getpwnam(user); if (ent == NULL) -- 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