diff mbox series

[Bluez,8/8] core: Initialize uuid_str_arr to NULL

Message ID 20210401182328.Bluez.8.I41e73e51a6a5d9cf4394903d631f41b69fb14fb6@changeid
State New
Headers show
Series Hi Linux-bluetooth, | expand

Commit Message

Howard Chung April 1, 2021, 10:24 a.m. UTC
From: Sonny Sasaka <sonnysasaka@chromium.org>

Not initializing may crash g_free() below.

Reviewed-by: Daniel Winkler <danielwinkler@google.com>
Reviewed-by: Alain Michaud <alainm@chromium.org>
---

 src/adapter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/src/adapter.c b/src/adapter.c
index f03eda2abc17..ab4f8a3ca4d7 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -483,7 +483,7 @@  static void store_adapter_info(struct btd_adapter *adapter)
 	char *str;
 	gsize length = 0;
 	gboolean discoverable;
-	char **uuid_str_arr;
+	char **uuid_str_arr = NULL;
 	guint num_of_uuid = 0;
 	int i;