lib/util: clang: Fix dereference of a null pointer warning
authorNoel Power <noel.power@suse.com>
Fri, 24 May 2019 14:08:58 +0000 (14:08 +0000)
committerNoel Power <npower@samba.org>
Tue, 11 Jun 2019 12:10:17 +0000 (12:10 +0000)
commite104c01846f6b8bcfb4a3efb269b8b357d17eea6
treeba0494aee39ac454c16e8aa7ddc087bbf558ad64
parentacd65542069457cf24dd64d5c6625e88cb7242fb
lib/util: clang: Fix dereference of a null pointer warning

Fixes:

lib/util/rbtree.c:170:8: warning: Access to field 'rb_parent_color' results in a dereference of a null pointer (loaded from variable 'other') <--[clang]

We could avoid accessing the NULL pointer but previously the code would
have crashed here. Given this is a rbtree probably better to preserve the
fatal nature of encountering a NULL pointer here while satisfying the static
checker.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer gary@catalyst.net.nz
lib/util/rbtree.c