* [PATCH] libtracefs: Free the regex in update_filter()
@ 2021-05-06 14:00 Steven Rostedt
0 siblings, 0 replies; only message in thread
From: Steven Rostedt @ 2021-05-06 14:00 UTC (permalink / raw)
To: Linux Trace Devel
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
A regex is used to match functions in update_filter() using the regcomp()
functionality. But regcomp() needs to release its resources via regfree()
which is lacking in this function.
Fixes: 2df4a7ea ("libtracefs: Add checking of available_filter_functions to tracefs_function_filter()")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
src/tracefs-tools.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/tracefs-tools.c b/src/tracefs-tools.c
index 6ef17f6..993fb3c 100644
--- a/src/tracefs-tools.c
+++ b/src/tracefs-tools.c
@@ -816,6 +816,7 @@ static int update_filter(const char *filter_path, int *fd,
}
out_free:
+ regfree(&func_filter.re);
free_func_list(func_list);
out:
pthread_mutex_unlock(lock);
--
2.29.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-05-06 14:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-06 14:00 [PATCH] libtracefs: Free the regex in update_filter() Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).