diff mbox series

[BlueZ,1/2] mesh: Fix uninitialized memory usage

Message ID 20230313190808.48102-1-brian.gix@gmail.com
State New
Headers show
Series [BlueZ,1/2] mesh: Fix uninitialized memory usage | expand

Commit Message

Brian Gix March 13, 2023, 7:08 p.m. UTC
When attempting to cancel an unknown Scan request structure must be
NULL initialized.
---
 mesh/manager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/mesh/manager.c b/mesh/manager.c
index e16dbc513..0c98721bf 100644
--- a/mesh/manager.c
+++ b/mesh/manager.c
@@ -709,7 +709,7 @@  static struct l_dbus_message *start_scan_call(struct l_dbus *dbus,
 	req = l_queue_remove_if(scans, by_node_svr, &new_req);
 
 	if (!req)
-		req = l_malloc(sizeof(new_req));
+		req = l_new(struct scan_req, 1);
 
 	if (req->timeout) {
 		l_timeout_remove(req->timeout);