From 8f556dac4f90e1ac8cdb7d5de624285d3d8baed7 Mon Sep 17 00:00:00 2001 From: Nedko Arnaudov Date: Sat, 6 Apr 2013 22:00:52 +0300 Subject: [PATCH] Make audio_acquire() fail if audio_reservation_init() fails. rd_acquire() is going to assert (or fail) anyway because connection will be NULL. --- dbus/audio_reserve.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dbus/audio_reserve.c b/dbus/audio_reserve.c index c915ba56..b9146c86 100644 --- a/dbus/audio_reserve.c +++ b/dbus/audio_reserve.c @@ -71,8 +71,11 @@ SERVER_EXPORT bool audio_acquire(const char * device_name) int ret; // Open DBus connection first time - if (gReserveCount == 0) - audio_reservation_init(); + if (gReserveCount == 0) { + if (audio_reservation_init() != 0) { + return false; + } + } assert(gReserveCount < DEVICE_MAX);