From: Jérémie Galarneau Date: Mon, 20 Aug 2018 19:17:05 +0000 (-0400) Subject: Fix: path leak on formatting error X-Git-Tag: v2.11.0-rc1~145 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=a0fda194a7bc479b43f1f76a0cbf3f0796e5b49a;p=lttng-tools.git Fix: path leak on formatting error 'tmp_path' is leaked if 'snprintf()' reports an error. Reported-by: Coverity Scan (1387044 Resource leak) Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 160f567c8..5cf904939 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -4446,6 +4446,7 @@ int ust_app_start_trace(struct ltt_ust_session *usess, struct ust_app *app) usess->consumer->dst.session_root_path, usess->consumer->chunk_path, usess->consumer->subdir); + free(tmp_path); goto error_unlock; }