libtraceevent: Fix check-after-deref coverity flaw
Before patch, both arg->bitmask.field and arg->string.field were checked
for being NULL and if yes, some value was assigned to them. The value
was immediately used (dereferenced) and after that, another check for
NULL was performed (the one leading to break command). However, in case
this check would be true, the dereferencing before would have already
caused a crash.
Move the NULL checks before dereferencing the pointers.
Link: https://lore.kernel.org/linux-trace-devel/20220930111002.6107-3-mpetlan@redhat.com
Signed-off-by: Michael Petlan <mpetlan@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 file changed