bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: Geliang Tang <geliang@kernel.org>,
	 Andrii Nakryiko <andrii@kernel.org>,
	 Eduard Zingerman <eddyz87@gmail.com>,
	 Mykola Lysenko <mykolal@fb.com>,
	 Alexei Starovoitov <ast@kernel.org>,
	 Daniel Borkmann <daniel@iogearbox.net>,
	 Martin KaFai Lau <martin.lau@linux.dev>,
	 Song Liu <song@kernel.org>,
	 Yonghong Song <yonghong.song@linux.dev>,
	 John Fastabend <john.fastabend@gmail.com>,
	 KP Singh <kpsingh@kernel.org>,
	 Stanislav Fomichev <sdf@google.com>,
	 Hao Luo <haoluo@google.com>,  Jiri Olsa <jolsa@kernel.org>,
	 Shuah Khan <shuah@kernel.org>,
	 Jakub Sitnicki <jakub@cloudflare.com>
Cc: Geliang Tang <tanggeliang@kylinos.cn>,
	 bpf@vger.kernel.org,  linux-kselftest@vger.kernel.org,
	 Geliang Tang <geliang@kernel.org>
Subject: RE: [PATCH bpf-next 2/2] selftests/bpf: Free strdup memory in veristat
Date: Mon, 29 Apr 2024 12:57:37 -0700	[thread overview]
Message-ID: <662ffbb148ea0_20421208ec@john.notmuch> (raw)
In-Reply-To: <ded44f8865cd7f337f52fc5fb0a5fbed7d6bd641.1714374022.git.tanggeliang@kylinos.cn>

Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> The strdup() function returns a pointer to a new string which is a
> duplicate of the string "input". Memory for the new string is obtained
> with malloc(), and need to be freed with free().
> 
> This patch adds these missing "free(input)" in parse_stats() to avoid
> memory leak in veristat.c.
> 
> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> ---

Acked-by: John Fastabend <john.fastabend@gmail.com>

  parent reply	other threads:[~2024-04-29 19:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-29  7:07 [PATCH bpf-next 0/2] Free strdup memory in selftests Geliang Tang
2024-04-29  7:07 ` [PATCH bpf-next 1/2] selftests/bpf: Free strdup memory in test_sockmap Geliang Tang
2024-04-29 15:53   ` Yonghong Song
2024-04-29 19:56   ` John Fastabend
2024-04-29  7:07 ` [PATCH bpf-next 2/2] selftests/bpf: Free strdup memory in veristat Geliang Tang
2024-04-29 15:53   ` Yonghong Song
2024-04-29 19:57   ` John Fastabend [this message]
2024-04-29 23:20 ` [PATCH bpf-next 0/2] Free strdup memory in selftests patchwork-bot+netdevbpf

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=662ffbb148ea0_20421208ec@john.notmuch \
    --to=john.fastabend@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=geliang@kernel.org \
    --cc=haoluo@google.com \
    --cc=jakub@cloudflare.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=mykolal@fb.com \
    --cc=sdf@google.com \
    --cc=shuah@kernel.org \
    --cc=song@kernel.org \
    --cc=tanggeliang@kylinos.cn \
    --cc=yonghong.song@linux.dev \
    /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).