Skip to contentSkip to conversation

Fix: relayd viewer stream: unhandled out of memory error

PATCH Jérémie Galarneau 1 participant 1 message Nov 27, 2014 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Merged all the way to 2.4, thanks!

Jérémie

Quoted 29 lines · Mathieu Desnoyers
---
 src/bin/lttng-relayd/viewer-stream.c | 8 ++++++++
 1 file changed, 8 insertions(+)
src/bin/lttng-relayd/viewer-stream.c +8 -1
index 2f5d6f7..3748629 100644
@@ -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

Signature · 8 lines
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev