commit | 8f2593fbbad2a549b854645acde7b11f5e02a924 | [log] [tgz] |
---|---|---|
author | Jerome Marchand <jmarchan@redhat.com> | Thu Jun 06 17:38:23 2024 +0200 |
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | Fri Jun 14 22:49:21 2024 -0400 |
tree | e67296c4d81f66a817a6c91896f90e4fd0c82832 | |
parent | 7d77b83ce83c318cb83cf2529f45cc950edb44d5 [diff] |
libtracefs: Prevent a memory leak in open_cpu_files() In open_cpu_files(), if realloc() fails, the latest allocated tcpu isn't freed. Rearrange the loop to prevent that. Link: https://lore.kernel.org/linux-trace-devel/20240606153830.2666120-10-jmarchan@redhat.com Fixes: 564bffddcb117 ("libtracefs: Use tracefs_cpu_read() for tracefs_iterate_raw_events()") Signed-off-by: Jerome Marchand <jmarchan@redhat.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>