From: David Marchand <david.marchand@redhat.com>
To: Ciara Power <ciara.power@intel.com>
Cc: dev <dev@dpdk.org>, Fan Zhang <roy.fan.zhang@intel.com>,
Marko Kovacevic <marko.kovacevic@intel.com>
Subject: Re: [dpdk-dev] [PATCH] examples/fips_validation: fix resource leak on failure
Date: Fri, 30 Oct 2020 14:08:58 +0100 [thread overview]
Message-ID: <CAJFAV8x2Lm=T1eOv=kaOQi_Av6RLZRx9o-yvL3=RaLFqgJ+LVQ@mail.gmail.com> (raw)
In-Reply-To: <20201028155327.104488-1-ciara.power@intel.com>
On Wed, Oct 28, 2020 at 4:53 PM Ciara Power <ciara.power@intel.com> wrote:
>
> The dst variable went out of scope on failure in the get_writeback_data
> function. This is now freed before returning -1.
>
> Coverity issue: 363453
> Fixes: 952e10cdad5e ("examples/fips_validation: support scatter gather list")
> Cc: roy.fan.zhang@intel.com
>
> Signed-off-by: Ciara Power <ciara.power@intel.com>
> ---
> examples/fips_validation/main.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c
> index 07532c9562..be38eb29b6 100644
> --- a/examples/fips_validation/main.c
> +++ b/examples/fips_validation/main.c
> @@ -1128,6 +1128,7 @@ get_writeback_data(struct fips_val *val)
>
> if (data_len) {
> RTE_LOG(ERR, USER1, "Error -1: write back data\n");
> + free(dst);
Hum should we instead free the pointer to the allocated buffer, i.e.
wb_data, rather than dst that got potentially incremented?
--
David Marchand
next prev parent reply other threads:[~2020-10-30 13:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-28 15:53 Ciara Power
2020-10-30 13:08 ` David Marchand [this message]
2020-10-30 17:36 ` [dpdk-dev] [PATCH v2] " Ciara Power
2020-10-31 17:09 ` David Marchand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJFAV8x2Lm=T1eOv=kaOQi_Av6RLZRx9o-yvL3=RaLFqgJ+LVQ@mail.gmail.com' \
--to=david.marchand@redhat.com \
--cc=ciara.power@intel.com \
--cc=dev@dpdk.org \
--cc=marko.kovacevic@intel.com \
--cc=roy.fan.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).