[lttng-dev] [PATCH] Fix: mi: snapshot: missing error handling for session name

Jonathan Rajotte jonathan.rajotte-julien at efficios.com
Tue Jan 6 10:59:47 EST 2015


Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien at efficios.com>
---
 src/common/mi-lttng.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/common/mi-lttng.c b/src/common/mi-lttng.c
index 752bcec..fed0985 100644
--- a/src/common/mi-lttng.c
+++ b/src/common/mi-lttng.c
@@ -1341,6 +1341,9 @@ int mi_lttng_snapshot_output_session_name(struct mi_writer *writer,
 	/* Snapshot output list for current session name */
 	ret = mi_lttng_writer_write_element_string(writer, config_element_name,
 			session_name);
+	if (ret) {
+		goto end;
+	}
 
 	/* Open element snapshots (sequence one snapshot) */
 	ret = mi_lttng_writer_open_element(writer, mi_lttng_element_snapshots);
-- 
1.9.1




More information about the lttng-dev mailing list