[PATHv2] adapter: Fix memory leak

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

 



From: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx>

In case of error with dbus stuff free allocated memory and set filter
to NULL.
---
 src/adapter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/adapter.c b/src/adapter.c
index 8ee5b5b..95b5349 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2220,7 +2220,7 @@ static bool parse_discovery_filter_dict(struct discovery_filter **filter,
 	dbus_message_iter_init(msg, &iter);
 	if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY ||
 	    dbus_message_iter_get_element_type(&iter) != DBUS_TYPE_DICT_ENTRY)
-		return false;
+		goto invalid_args;
 
 	dbus_message_iter_recurse(&iter, &subiter);
 	do {
-- 
2.1.4

--
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