tracing: prevent memory leak
PATCH 1/1 tracing: prevent memory leak
In predicate_parse, there is an error path that is not going to out_free instead it returns directly which leads to memory leak.
Signed-off-by Navid Emamdoost <[email protected]>
--- kernel/trace/trace_events_filter.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
kernel/trace/trace_events_filter.c +4 -2
@@ -452,8 +452,10 @@ predicate_parse(const char *str, int nr_parens, int nr_preds,switch (*next) {case '(' :/* #2 */ -if (top - op_stack > nr_parens) -return ERR_PTR (-EINVAL ); +if (top - op_stack > nr_parens) { + ret = -EINVAL ; + goto out_free; + } *(++top) = invert;continue ;case '!' :/* #3 */
Signature · 1 line
2.17.1