From b71d1a35b3efa61f167b14d23a5c4839c004d700 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 7 Oct 2008 15:30:28 +0200 Subject: 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. --- audio/headset.c | 3 +++ 1 file changed, 3 insertions(+) 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 #include #include +#include #include #include @@ -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; -- cgit