mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-16 17:57:38 -04: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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user