X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fconsumer.c;h=53806b08d8ee4a0dcd54b80ee71edaca221fd784;hp=a9e4dee661b1d1ba13da01a2db4d74ee16f68e8e;hb=633d0084183d5b0aed953ce267e0e57e5ef29bd5;hpb=c80048c6378b9ee7796c4b833a2c07f6050cc6d7 diff --git a/src/common/consumer.c b/src/common/consumer.c index a9e4dee66..53806b08d 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -1723,20 +1723,13 @@ restart: close(ctx->consumer_metadata_pipe[0]); continue; } else if (revents & LPOLLIN) { - stream = zmalloc(sizeof(struct lttng_consumer_stream)); - if (stream == NULL) { - PERROR("zmalloc metadata consumer stream"); - goto error; - } - do { - /* Get the stream and add it to the local hash table */ - ret = read(pollfd, stream, - sizeof(struct lttng_consumer_stream)); + /* Get the stream pointer received */ + ret = read(pollfd, &stream, sizeof(stream)); } while (ret < 0 && errno == EINTR); - if (ret < 0 || ret < sizeof(struct lttng_consumer_stream)) { + if (ret < 0 || + ret < sizeof(struct lttng_consumer_stream *)) { PERROR("read metadata stream"); - free(stream); /* * Let's continue here and hope we can still work * without stopping the consumer. XXX: Should we?