From 47f51a98c521f937edb4edacd9d9a52f272520a3 Mon Sep 17 00:00:00 2001 From: Yun-Hao Chung Date: Fri, 7 May 2021 12:32:57 +0800 Subject: [PATCH] core: Fix loading AVDTP options Fix misassigned AVDTP StreamMode option, which causes StreamMode not being set. Fix AVDTP SessionMode option not freed. Reviewed-by: mmandlik@chromium.org Reviewed-by: apusaka@chromium.org Reviewed-by: Tedd Ho-Jeong An --- src/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 37ed4568b..ed19e3e28 100644 --- a/src/main.c +++ b/src/main.c @@ -781,9 +781,10 @@ static void parse_config(GKeyFile *config) DBG("Invalid mode option: %s", str); btd_opts.avdtp.session_mode = BT_IO_MODE_BASIC; } + g_free(str); } - val = g_key_file_get_integer(config, "AVDTP", "StreamMode", &err); + str = g_key_file_get_string(config, "AVDTP", "StreamMode", &err); if (err) { DBG("%s", err->message); g_clear_error(&err); @@ -798,6 +799,7 @@ static void parse_config(GKeyFile *config) DBG("Invalid mode option: %s", str); btd_opts.avdtp.stream_mode = BT_IO_MODE_BASIC; } + g_free(str); } parse_br_config(config); -- 2.47.3