From: Mathieu Desnoyers Date: Thu, 18 Dec 2014 01:45:14 +0000 (-0500) Subject: Fix: ust app leak on UST buffer creation error X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=e64207cf612a1e1a34131427b7cea17ce82ea091;hp=286c991af026bfd127e1de5f97976ff8b291721e Fix: ust app leak on UST buffer creation error Signed-off-by: Mathieu Desnoyers 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 9dbd49bc3..3abd12716 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -1875,6 +1875,7 @@ static int create_ust_app_session(struct ltt_ust_session *usess, /* Init local registry. */ ret = setup_buffer_reg_pid(ua_sess, app, NULL); if (ret < 0) { + delete_ust_app_session(-1, ua_sess, app); goto error; } break; @@ -1882,6 +1883,7 @@ static int create_ust_app_session(struct ltt_ust_session *usess, /* Look for a global registry. If none exists, create one. */ ret = setup_buffer_reg_uid(usess, app, NULL); if (ret < 0) { + delete_ust_app_session(-1, ua_sess, app); goto error; } break;