linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Chen Wandun <chenwandun@huawei.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	bpf@vger.kernel.org
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Cheng Jian <cj.chengjian@huawei.com>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH v2 2/2] perf tools: Improve exception handling in two functions of perf events parser
Date: Thu, 11 Jun 2020 21:09:22 +0200	[thread overview]
Message-ID: <685bb0ec-c08a-d7e5-6aa3-fb7ca842d0d0@web.de> (raw)
In-Reply-To: <20200611145605.21427-3-chenwandun@huawei.com>

> Fix potential memory leak. Function new_term may return error, so
> it is need to free memory when the return value is negative.

How do you think about a wording variant like the following?

   Add jump targets so that a configuration object and a duplicated string
   are released after a call of the function “strdup” or “new_term” failed.

Regards,
Markus

      reply	other threads:[~2020-06-11 19:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-11 14:56 [PATCH next v2 0/2] fix potential memleak in perf events parser Chen Wandun
2020-06-11 14:56 ` [PATCH next v2 1/2] perf tools: " Chen Wandun
2020-06-11 18:50   ` [PATCH v2 1/2] perf tools: Fix potential memory leaks " Markus Elfring
2020-06-12 10:01     ` Greg KH
2020-06-14  3:39     ` Chen Wandun
2020-06-11 14:56 ` [PATCH next v2 2/2] perf tools: fix potential memleak " Chen Wandun
2020-06-11 19:09   ` Markus Elfring [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=685bb0ec-c08a-d7e5-6aa3-fb7ca842d0d0@web.de \
    --to=markus.elfring@web.de \
    --cc=acme@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=chenwandun@huawei.com \
    --cc=cj.chengjian@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=peterz@infradead.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).