[dpdk-stable] [PATCH v3] tests/cmdline: fix memory leaks

David Marchand david.marchand at redhat.com
Thu Jun 24 15:24:53 CEST 2021


On Thu, Jun 24, 2021 at 2:08 PM Olivier Matz <olivier.matz at 6wind.com> wrote:
> > -     if (cmdline_file_new(&ctx, "prompt", "/dev/null") == NULL) {
> > +     cl = cmdline_file_new(&ctx, "prompt", "/dev/null");
> > +     if (cl == NULL) {
> >               printf("Error: failed to open /dev/null for reading!");
> > +             cmdline_free(cl);
> >               return -1;
> >       }
>
> The cmdline_free(cl) after a if (cl == NULL) is not needed.

I took the liberty of doing the change when applying and added your ack.
Thanks.


-- 
David Marchand



More information about the stable mailing list