From: Mathieu Desnoyers Date: Fri, 21 Nov 2014 17:49:08 +0000 (+0100) Subject: Fix: relayd viewer stream: unhandled out of memory error X-Git-Tag: v2.5.3~34 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b5d5aa8aa3b95682a1331810c44ba38f853e86bd;p=lttng-tools.git Fix: relayd viewer stream: unhandled out of memory error Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-relayd/viewer-stream.c b/src/bin/lttng-relayd/viewer-stream.c index 5ab7be790..f4bf13f69 100644 --- a/src/bin/lttng-relayd/viewer-stream.c +++ b/src/bin/lttng-relayd/viewer-stream.c @@ -57,8 +57,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;