DPDK patches and discussions
 help / color / mirror / Atom feed
From: Kevin Laatz <kevin.laatz@intel.com>
To: Ciara Power <ciara.power@intel.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] test/telemetry: fix socket resource leak
Date: Thu, 15 Oct 2020 18:02:22 +0100	[thread overview]
Message-ID: <7d320cfb-a211-69cd-dbff-68fe8b7f7ad0@intel.com> (raw)
In-Reply-To: <20201013155648.3471-1-ciara.power@intel.com>

On 13/10/2020 16:56, Ciara Power wrote:
> If an error occurred when reading from the socket, the function
> returned without closing the socket. This is now fixed to avoid the
> resource leak of the sock variable going out of scope.
>
> Fixes: bd78cf693ebd ("test/telemetry: add unit tests for data to JSON")
> Coverity issue: 363043
>
> Signed-off-by: Ciara Power <ciara.power@intel.com>
> ---
>   app/test/test_telemetry_data.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/app/test/test_telemetry_data.c b/app/test/test_telemetry_data.c
> index 7a31e68a78..f3807a7255 100644
> --- a/app/test/test_telemetry_data.c
> +++ b/app/test/test_telemetry_data.c
> @@ -327,6 +327,7 @@ connect_to_socket(void)
>   	if (bytes < 0) {
>   		printf("%s: Error with socket read - %s\n", __func__,
>   				strerror(errno));
> +		close(sock);
>   		return -1;
>   	}
>   	buf[bytes] = '\0';


Acked-by: Kevin Laatz <kevin.laatz@intel.com>


  reply	other threads:[~2020-10-15 17:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-13 15:56 Ciara Power
2020-10-15 17:02 ` Kevin Laatz [this message]
2020-10-19 14:59   ` Thomas Monjalon

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=7d320cfb-a211-69cd-dbff-68fe8b7f7ad0@intel.com \
    --to=kevin.laatz@intel.com \
    --cc=ciara.power@intel.com \
    --cc=dev@dpdk.org \
    /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).