[PATCH] dbus: Add an assertion to get rid of a warning from Coverity.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Coverity thinks that sample can be NULL when it's
dereferenced after this line. Adding an assertion doesn't
hurt here (in my opinion), and that should get rid of the
warning.
---
 src/modules/dbus/iface-core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/modules/dbus/iface-core.c b/src/modules/dbus/iface-core.c
index 58abcb9..97a46a5 100644
--- a/src/modules/dbus/iface-core.c
+++ b/src/modules/dbus/iface-core.c
@@ -1401,7 +1401,7 @@ static void handle_upload_sample(DBusConnection *conn, DBusMessage *msg, void *u
         goto finish;
     }
 
-    sample = pa_idxset_get_by_index(c->core->scache, idx);
+    pa_assert_se(sample = pa_idxset_get_by_index(c->core->scache, idx));
 
     if (n_volume_entries > 0) {
         sample->volume.channels = n_channels;
-- 
1.7.8



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux