From 5a872af406ca2d432e79d978f23a85771c7ce6ea Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 21 Nov 2022 13:01:46 -0800 Subject: [PATCH] client/player: Fix scan-build warning This fixes the following warning: client/player.c:1775:25: warning: Dereference of null pointer [core.NullDereference] iov_append(&cfg->caps, preset->data.iov_base, preset->data.iov_len); ^~~~~~~~~~~~~~~~~~~~~ --- client/player.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/player.c b/client/player.c index 432408934..51c10f8e0 100644 --- a/client/player.c +++ b/client/player.c @@ -1745,6 +1745,9 @@ static DBusMessage *endpoint_select_properties_reply(struct endpoint *ep, DBusMessageIter iter; struct endpoint_config *cfg; + if (!preset) + return NULL; + reply = dbus_message_new_method_return(msg); if (!reply) return NULL;