[v4,03/11] trace: fix leak with regexp
Checks
Commit Message
The precompiled buffer initialised in regcomp must be freed before
leaving rte_trace_regexp.
Fixes: 84c4fae4628f ("trace: implement operation APIs")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>
---
Changes since v1:
- split patch in two, keeping only the backportable fix as patch 3,
---
lib/eal/common/eal_common_trace.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
@@ -218,8 +218,10 @@ rte_trace_regexp(const char *regex, bool enable)
rc = rte_trace_point_disable(tp->handle);
found = 1;
}
- if (rc < 0)
- return rc;
+ if (rc < 0) {
+ found = 0;
+ break;
+ }
}
regfree(&r);