mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
tracing/synthetic: Free type string on error path
parse_synth_field() builds a "__data_loc ..." type string before assigning it to field->type. If the seq_buf check fails, the common cleanup cannot free the temporary string. Free it before leaving. Link: https://patch.msgid.link/20260603062533.1096320-2-pengyu@kylinos.cn Signed-off-by: Yu Peng <pengyu@kylinos.cn> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
This commit is contained in:
parent
50fd6dd755
commit
05074bb90a
|
|
@ -839,8 +839,10 @@ static struct synth_field *parse_synth_field(int argc, char **argv,
|
|||
seq_buf_puts(&s, "__data_loc ");
|
||||
seq_buf_puts(&s, field->type);
|
||||
|
||||
if (WARN_ON_ONCE(!seq_buf_buffer_left(&s)))
|
||||
if (WARN_ON_ONCE(!seq_buf_buffer_left(&s))) {
|
||||
kfree(type);
|
||||
goto free;
|
||||
}
|
||||
s.buffer[s.len] = '\0';
|
||||
|
||||
kfree(field->type);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user