> -----Original Message----- > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Pablo de Lara > Sent: Monday, July 18, 2016 1:01 PM > To: dev at dpdk.org > Cc: Doherty, Declan <declan.doherty at intel.com>; De Lara Guarch, Pablo > <pablo.de.lara.guarch at intel.com> > Subject: [dpdk-dev] [PATCH] crypto: fix memory leak > > When parsing the parameters for virtual device initialization, rte_kvargs > structure was being freed only if there was an error, not when parsing was > successful. > > Coverity issue: 124568 > > Fixes: f3e764fa2fb7 ("cryptodev: uninline parameter parsing") > > Signed-off-by: Pablo de Lara <pablo.de.lara.guarch at intel.com> > --- > --- a/lib/librte_cryptodev/rte_cryptodev.c > +++ b/lib/librte_cryptodev/rte_cryptodev.c > @@ -148,7 +148,7 @@ int > int ret;
You can initialize ret to 0 here instead of below. > > if (params == NULL) > @@ -187,10 +187,11 @@ rte_cryptodev_parse_vdev_init_params(struct > rte_crypto_vdev_init_params *params, > } > } > > - return 0; > + ret = 0;