From: David Goulet Date: Mon, 4 Nov 2013 21:34:38 +0000 (-0500) Subject: Fix: Uninitialized scalar variable X-Git-Tag: v2.4.0-rc1~78 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=0233a6a578456d763172c241a99ed7254fa50998;p=lttng-tools.git Fix: Uninitialized scalar variable Fix coverity issue 1099611. Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-relayd/live.c b/src/bin/lttng-relayd/live.c index 1bcab0a85..26d6e33d5 100644 --- a/src/bin/lttng-relayd/live.c +++ b/src/bin/lttng-relayd/live.c @@ -1128,6 +1128,9 @@ int viewer_get_packet(struct relay_command *cmd) } health_code_update(); + /* From this point on, the error label can be reached. */ + memset(&reply, 0, sizeof(reply)); + rcu_read_lock(); stream = live_find_viewer_stream_by_id(be64toh(get_packet_info.stream_id)); if (!stream) { @@ -1156,14 +1159,11 @@ int viewer_get_packet(struct relay_command *cmd) stream->read_fd = ret; } - memset(&reply, 0, sizeof(reply)); - if (!stream->ctf_trace->metadata_received || stream->ctf_trace->metadata_received > stream->ctf_trace->metadata_sent) { reply.status = htobe32(VIEWER_GET_PACKET_ERR); reply.flags |= LTTNG_VIEWER_FLAG_NEW_METADATA; - goto send_reply; }