client/player: Fix scan-build warning
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 21 Nov 2022 21:01:46 +0000 (13:01 -0800)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 5 Jan 2024 10:11:34 +0000 (15:41 +0530)
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

index 996da26..43934cd 100644 (file)
@@ -1744,6 +1744,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;