From: Jérémie Galarneau Date: Wed, 25 Sep 2019 20:55:35 +0000 (-0400) Subject: Fix: tests: leak of prefix on error to register lttng namespace X-Git-Tag: v2.11.0-rc4~6 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=4482e9a8a55289303fb125bcc5b0da5f71a6045b;p=lttng-tools.git Fix: tests: leak of prefix on error to register lttng namespace prefix should always be free'd in this function. 1402045 Resource leak The system resource will not be reclaimed and reused, reducing the future availability of the resource. In register_lttng_namespace: Leak of memory or pointers to system resources (CWE-404) Reported-by: Coverity Scan Signed-off-by: Jérémie Galarneau --- diff --git a/tests/regression/tools/mi/extract_xml.c b/tests/regression/tools/mi/extract_xml.c index ddf8c1677..ae07689e2 100644 --- a/tests/regression/tools/mi/extract_xml.c +++ b/tests/regression/tools/mi/extract_xml.c @@ -155,8 +155,8 @@ static int register_lttng_namespace(xmlXPathContextPtr xpathCtx) } ret = xmlXPathRegisterNs(xpathCtx, prefix, ns); - xmlFree(prefix); end: + xmlFree(prefix); xmlFree(ns); return ret; }