Fix: Uninitialized scalar variable
authorDavid Goulet <dgoulet@efficios.com>
Mon, 4 Nov 2013 21:34:38 +0000 (16:34 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Mon, 4 Nov 2013 21:34:38 +0000 (16:34 -0500)
Fix coverity issue 1099611.

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-relayd/live.c

index 1bcab0a85073eb78225a98d7b15e4f2013c00115..26d6e33d505447918e659255faee54b129ede6c7 100644 (file)
@@ -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;
        }
 
This page took 0.026245 seconds and 4 git commands to generate.