From 52d8ccce6a092485def268cb278485d2820c4954 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 18 Jun 2013 15:33:05 -0400 Subject: [PATCH] Remove useless if() check 1022350 Dereference before null check In ust_registry_session_destroy: All paths that lead to this null pointer comparison already dereference the pointer earlier (CWE-476) Signed-off-by: Mathieu Desnoyers --- src/bin/lttng-sessiond/ust-registry.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/bin/lttng-sessiond/ust-registry.c b/src/bin/lttng-sessiond/ust-registry.c index 298ddbb6a..e22fc6fcf 100644 --- a/src/bin/lttng-sessiond/ust-registry.c +++ b/src/bin/lttng-sessiond/ust-registry.c @@ -556,8 +556,6 @@ void ust_registry_session_destroy(struct ust_registry_session *reg) } rcu_read_unlock(); - if (reg->channels) { - ht_cleanup_push(reg->channels); - } + ht_cleanup_push(reg->channels); free(reg->metadata); } -- 2.34.1