lkml.org 
[lkml]   [2024]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: tracing/probes: Fix a memory leak in traceprobe_parse_probe_arg_body()
From

> ----
> 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

\
 
 \ /
  Last update: 2024-05-27 18:05    [W:0.025 / U:0.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site