From: Ye Xiaolong <xiaolong.ye@intel.com>
To: Xiaoyun Li <xiaoyun.li@intel.com>
Cc: jingjing.wu@intel.com, dev@dpdk.org, stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] examples/ntb: fix resource leaks
Date: Wed, 14 Aug 2019 14:50:06 +0800 [thread overview]
Message-ID: <20190814065006.GA25496@intel.com> (raw)
In-Reply-To: <20190814060725.43129-1-xiaoyun.li@intel.com>
On 08/14, Xiaoyun Li wrote:
>Resource file was not freed or pointed-to in fseek/ftell. This patch
>fixed this issue which is found by coverity scan.
>
>Coverity issue: 347277
>Fixes: 440af660ff83 ("examples/ntb: fix error handling")
>Cc: stable@dpdk.org
>
>Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
>---
> examples/ntb/ntb_fwd.c | 2 ++
> 1 file changed, 2 insertions(+)
>
>diff --git a/examples/ntb/ntb_fwd.c b/examples/ntb/ntb_fwd.c
>index f8c970cdb..bf8a73547 100644
>--- a/examples/ntb/ntb_fwd.c
>+++ b/examples/ntb/ntb_fwd.c
>@@ -127,11 +127,13 @@ cmd_sendfile_parsed(void *parsed_result,
>
> if (fseek(file, 0, SEEK_END) < 0) {
> printf("Fail to get file size.\n");
>+ fclose(file);
> return;
> }
> size = ftell(file);
> if (fseek(file, 0, SEEK_SET) < 0) {
> printf("Fail to get file size.\n");
>+ fclose(file);
> return;
> }
>
>--
>2.17.1
>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
prev parent reply other threads:[~2019-08-14 6:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-14 6:07 [dpdk-dev] [PATCH] examples/ntb: fix resource leaks Xiaoyun Li
2019-08-14 6:50 ` Ye Xiaolong [this message]
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=20190814065006.GA25496@intel.com \
--to=xiaolong.ye@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
--cc=stable@dpdk.org \
--cc=xiaoyun.li@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.