From 9d09662560d7a9f8b43834b823281ab23cc040ac 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 Signed-off-by: Anuj Jain Signed-off-by: Ayush Garg --- src/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 0735ab2..7b4444f 100755 --- a/src/main.c +++ b/src/main.c @@ -811,9 +811,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); @@ -828,6 +829,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.7.4