[lttng-dev] [PATCH lttng-tools] Fix: relayd viewer stream: unhandled out of memory error
Jérémie Galarneau
jeremie.galarneau at efficios.com
Thu Nov 27 17:31:45 EST 2014
Merged all the way to 2.4, thanks!
Jérémie
On Fri, Nov 21, 2014 at 12:49 PM, Mathieu Desnoyers
<mathieu.desnoyers at efficios.com> wrote:
> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
> ---
> src/bin/lttng-relayd/viewer-stream.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/src/bin/lttng-relayd/viewer-stream.c b/src/bin/lttng-relayd/viewer-stream.c
> index 2f5d6f7..3748629 100644
> --- a/src/bin/lttng-relayd/viewer-stream.c
> +++ b/src/bin/lttng-relayd/viewer-stream.c
> @@ -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;
> --
> 2.1.1
>
--
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
More information about the lttng-dev
mailing list