[PATCH] health: Fix not setting error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx>

When error is not set err->message may be accessed from the other code
resulting in NULL dereference.
---
 android/mcap-lib.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/android/mcap-lib.c b/android/mcap-lib.c
index b04eaac..e0e1258 100644
--- a/android/mcap-lib.c
+++ b/android/mcap-lib.c
@@ -1932,6 +1932,8 @@ gboolean mcap_create_mcl(struct mcap_instance *mi,
 		}
 		mcap_mcl_unref(con->mcl);
 		g_free(con);
+		g_set_error(err, MCAP_ERROR, MCAP_ERROR_FAILED,
+							"MCP connect failed");
 		return FALSE;
 	}
 
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux