[EXT] Re: [PATCH v2] examples/fips_validation: fix memory leak in sha test
Gowrishankar Muthukrishnan
gmuthukrishn at marvell.com
Mon Jul 4 10:18:33 CEST 2022
> vec.cipher_auth.digest.len * 8);
> > + if (vec.cipher_auth.digest.val)
> > + free(vec.cipher_auth.digest.val);
>
> Unneeded if().
>
Ack.
> We just did a tree-wide cleanup to avoid these.
> Please don't reintroduce some.
>
>
> > +
> > + vec.cipher_auth.digest.val = calloc(1,
> > + vec.cipher_auth.digest.len);
>
> Don't we need to check for allocation success?
>
Sure. I ll post fix for the above and thanks for the review.
Regards,
Gowrishankar
>
> > break;
> > }
> > }
> >
> > - if (i == RTE_DIM(phsc))
> > + if (i == RTE_DIM(phsc)) {
> > + free(vec.cipher_auth.digest.val);
> > + vec.cipher_auth.digest.val = NULL;
> > return -1;
> > + }
> >
> > return 0;
> > }
>
>
> --
> David Marchand
More information about the dev
mailing list