From b019620d62206d12b962d99bb1b02186209caa9d Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 3 Apr 2018 10:11:34 -0400 Subject: [PATCH] Fix: unchecked return value of domain_mkdir() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/cmd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index e88d7a2f7..bdc6db89d 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -4564,9 +4564,12 @@ int cmd_rotate_session(struct ltt_session *session, ret = domain_mkdir(session->ust_session->consumer, session, session->ust_session->uid, session->ust_session->gid); + if (ret) { + ret = -LTTNG_ERR_CREATE_DIR_FAIL; + goto end; + } ret = ust_app_rotate_session(session, &ust_active); if (ret != LTTNG_OK) { - ret = -LTTNG_ERR_CREATE_DIR_FAIL; goto end; } /* -- 2.34.1