Prevent a segfault on premature error such arguments parsing error etc.

Signed-off-by: Jonathan Rajotte <[email protected]>
---
 src/bin/lttng-relayd/main.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c
index 7fc2fb5..eebb552 100644
--- a/src/bin/lttng-relayd/main.c
+++ b/src/bin/lttng-relayd/main.c
@@ -485,9 +485,12 @@ static void print_global_objects(void)
 {
        rcu_register_thread();
 
-       print_viewer_streams();
-       print_relay_streams();
-       print_sessions();
+       if (viewer_streams_ht)
+               print_viewer_streams();
+       if (relay_streams_ht)
+               print_relay_streams();
+       if (sessions_ht)
+               print_sessions();
 
        rcu_unregister_thread();
 }
-- 
2.1.4


_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

Reply via email to