Fix: unchecked return value in relayd live.c
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 17 May 2016 16:13:13 +0000 (12:13 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 20 May 2016 19:16:45 +0000 (15:16 -0400)
CID 1323137 (#1 of 1): Unchecked return value (CHECKED_RETURN)30.
check_return: Calling viewer_stream_get without checking return value
(as is done elsewhere 5 out of 6 times).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/live.c

index 06eba74d7dbf4d1e0d5243a9f03df4cf58b46a0e..45ac5d55fd7e7dd7cf9fb8b268877b03e0c464a1 100644 (file)
@@ -341,7 +341,10 @@ int make_viewer_streams(struct relay_session *session,
                                 * Ensure a self-reference is preserved even
                                 * after we have put our local reference.
                                 */
-                               viewer_stream_get(vstream);
+                               if (!viewer_stream_get(vstream)) {
+                                       ERR("Unable to get self-reference on viewer stream, logic error.");
+                                       abort();
+                               }
                        } else {
                                if (!vstream->sent_flag && nb_unsent) {
                                        /* Update number of unsent stream counter. */
This page took 0.026331 seconds and 4 git commands to generate.