[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <77a68fbd-5675-45e7-b563-883e5c0643cb@web.de>
Date: Fri, 26 Apr 2024 18:45:21 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Masami Hiramatsu <mhiramat@...nel.org>, lumingyindetect@....com,
linux-trace-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Cc: LKML <linux-kernel@...r.kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Steven Rostedt <rostedt@...dmis.org>
Subject: Re: tracing/probes: Fix a memory leak in
traceprobe_parse_probe_arg_body()
…
> ----
> If traceprobe_parse_probe_arg_body() fails to allocate 'parg->fmt', it
> jumps to 'out' instead of 'fail' by mistake. In the result, in this
> case the 'tmp' buffer is not freed and leaks its memory.
>
> Fix it by jumping to 'fail' in that case.
> ----
…
How do you think about another approach for a more desirable change description?
If traceprobe_parse_probe_arg_body() failed to allocate the object “parg->fmt”,
it jumps to the label “out” instead of “fail” by mistake.
In the result, the buffer “tmp” is not freed in this case and leaks its memory.
Thus jump to the label “fail” in that case (so that the exception handling
will be improved another bit).
Regards,
Markus
Powered by blists - more mailing lists