diff options
-rw-r--r-- | audio/avdtp.c | 17 | ||||
-rw-r--r-- | audio/control.c | 17 | ||||
-rw-r--r-- | audio/main.c | 3 |
3 files changed, 20 insertions, 17 deletions
diff --git a/audio/avdtp.c b/audio/avdtp.c index 7290578b..c74c99e0 100644 --- a/audio/avdtp.c +++ b/audio/avdtp.c @@ -2940,14 +2940,15 @@ int avdtp_init(GKeyFile *config) if (avdtp_server) return 0; - tmp = g_key_file_get_boolean(config, "General", "Master", - &err); - if (err) { - debug("audio.conf: %s", err->message); - g_error_free(err); - err = NULL; - } else - master = tmp; + if (config) { + tmp = g_key_file_get_boolean(config, "General", + "Master", &err); + if (err) { + debug("audio.conf: %s", err->message); + g_error_free(err); + } else + master = tmp; + } avdtp_server = avdtp_server_socket(master); if (!avdtp_server) diff --git a/audio/control.c b/audio/control.c index 6bf05bef..4e8b948d 100644 --- a/audio/control.c +++ b/audio/control.c @@ -915,14 +915,15 @@ int avrcp_init(DBusConnection *conn, GKeyFile *config) if (avctp_server) return 0; - tmp = g_key_file_get_boolean(config, "General", "Master", - &err); - if (err) { - debug("audio.conf: %s", err->message); - g_error_free(err); - err = NULL; - } else - master = tmp; + if (config) { + tmp = g_key_file_get_boolean(config, "General", + "Master", &err); + if (err) { + debug("audio.conf: %s", err->message); + g_error_free(err); + } else + master = tmp; + } connection = dbus_connection_ref(conn); diff --git a/audio/main.c b/audio/main.c index ef606223..6419da9a 100644 --- a/audio/main.c +++ b/audio/main.c @@ -93,7 +93,8 @@ static int audio_init(void) return -EIO; } - g_key_file_free(config); + if (config) + g_key_file_free(config); register_service("audio", uuids); |