Re: [PATCH 4/4] rt-tests: deadline_test: add missing frees

Kurt Kanzenbach
2019-04-04T15:20:01Z

[-- Attachment #1: Type: text/plain, Size: 1124 bytes --]

Hi,

On Thu, Apr 04, 2019 at 05:13:51PM +0200, John Kacur wrote:
>
>
> On Thu, 4 Apr 2019, Kurt Kanzenbach wrote:
>
> > The threads and thread data structures are allocated using calloc(). But never
> > free'd. So, free them.
> >
> > While here, remove the if statement for setcpu_buf. Free() is NULL safe.
> >
> > Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
> > ---
> > src/sched_deadline/deadline_test.c | 5 +++--
> > 1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/sched_deadline/deadline_test.c b/src/sched_deadline/deadline_test.c
> > index 4826557d0624..69e6fd18b73b 100644
> > --- a/src/sched_deadline/deadline_test.c
> > +++ b/src/sched_deadline/deadline_test.c
> > @@ -2092,8 +2092,9 @@ int main (int argc, char **argv)
> > printf("\n");
> > }
> >
> > - if (!setcpu_buf)
> > - free(setcpu_buf);
> > + free(thread);
> > + free(sched_data);
> > + free(setcpu_buf);
> >
> > return 0;
> > }
> > --
> > 2.11.0
>
> Does this remove your own if statement that I didn't even apply yet?
> :)

No. That's a different binary. My patch was made against cyclicdeadline.

Thanks,
Kurt

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]