Fix: relayd viewer stream: unhandled out of memory error
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 21 Nov 2014 17:49:08 +0000 (18:49 +0100)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 23 Nov 2014 15:24:44 +0000 (10:24 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/viewer-stream.c

index 2f5d6f788f13ff8a3c35d9aec91ba0e15624a7cc..37486293f8e8b5df965b2054978cee3aa3b46566 100644 (file)
@@ -58,8 +58,16 @@ struct relay_viewer_stream *viewer_stream_create(struct relay_stream *stream,
        vstream->session_id = stream->session_id;
        vstream->stream_handle = stream->stream_handle;
        vstream->path_name = strndup(stream->path_name, LTTNG_VIEWER_PATH_MAX);
+       if (vstream->path_name == NULL) {
+               PERROR("relay viewer path_name alloc");
+               goto error;
+       }
        vstream->channel_name = strndup(stream->channel_name,
                        LTTNG_VIEWER_NAME_MAX);
+       if (vstream->channel_name == NULL) {
+               PERROR("relay viewer channel_name alloc");
+               goto error;
+       }
        vstream->tracefile_count = stream->tracefile_count;
        vstream->metadata_flag = stream->metadata_flag;
        vstream->tracefile_count_last = -1ULL;
This page took 0.02441 seconds and 4 git commands to generate.