mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
tracing: Have error path in predicate_parse() free its allocated memory
[ Upstream commit 96c5c6e6a5 ]
In predicate_parse, there is an error path that is not going to
out_free instead it returns directly which leads to a memory leak.
Link: http://lkml.kernel.org/r/20190920225800.3870-1-navid.emamdoost@gmail.com
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e15f8a9b00
commit
7deb2dcb89
@@ -451,8 +451,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 */
|
||||
|
||||
Reference in New Issue
Block a user