Skip to contentSkip to conversation

Fix: unchecked return value in relayd live.c

PATCH Jérémie Galarneau 1 participant 1 message May 18, 2016 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]

Jérémie Galarneau

author Applied
#1 lore raw

Merged, thanks!

Jérémie

Quoted 28 lines · Mathieu Desnoyers

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).

---
 src/bin/lttng-relayd/live.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
src/bin/lttng-relayd/live.c +4 -2
index 82bd2bd..0a66405 100644
@@ -339,7 +339,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. */
--

2.1.4

Signature · 7 lines
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev