summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-10-07 15:30:28 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2008-10-07 15:30:28 +0200
commitb71d1a35b3efa61f167b14d23a5c4839c004d700 (patch)
treefc4fa4caeb273d06383a74dc3eeea92bce1599c5
parent43935523c41ec9b40f65e51b9d912239ded47066 (diff)
Assert that device->headset != NULL for each active device
We got one segfault due to hs == NULL but I couldn't figure out how on earth in could happen. The best I can do right now is to have an assert to catch it instead of a direct segfault.
-rw-r--r--audio/headset.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/audio/headset.c b/audio/headset.c
index 7e2b840d..2e0f6c9c 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -37,6 +37,7 @@
#include <getopt.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
+#include <assert.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
@@ -1397,6 +1398,8 @@ static void send_foreach_headset(GSList *devices,
struct headset *hs = device->headset;
int ret;
+ assert(hs != NULL);
+
if (cmp && cmp(hs) != 0)
continue;