[LTP] [PATCH] syscalls/pipe06: Rewrite the test using new LTP API

Avinesh Kumar akumar@suse.de
Tue Jul 18 11:27:29 CEST 2023


Hi Petr,

On Tuesday, July 18, 2023 1:53:13 PM IST Petr Vorel wrote:
> Hi Avinesh,
> 
> >  testcases/kernel/syscalls/pipe/pipe06.c | 133 ++++++------------------
> 
> ...
> 
> > +static void setup(void)
> > 
> >  {
> > 
> > +	int max_fds;
> > 
> > -		/* reset tst_count in case we are looping */
> > -		tst_count = 0;
> > +	max_fds = getdtablesize();
> > +	tst_res(TINFO, "getdtablesize() = %d", max_fds);
> > +	opened_fds = SAFE_MALLOC(max_fds * sizeof(int));
> 
> You don't free opened_fds in cleanup, that would be a memory leak.
Thank you for reviewing and catching this issue. I've sent a v2 with
your suggested fix.


Regards,
Avinesh




More information about the ltp mailing list