[PATCH BlueZ] core: Fix memory leak

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

 



When ignoring a LE device that is not in a discoverable state 'alias'
is leaking.
---
 src/adapter.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/adapter.c b/src/adapter.c
index b642e37..532fcdd 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2707,8 +2707,10 @@ void adapter_emit_device_found(struct btd_adapter *adapter,
 
 		/* Avoid emitting DeviceFound() signal if device is not
 		 * discoverable */
-		if (!(dev->flags & (EIR_LIM_DISC | EIR_GEN_DISC)))
+		if (!(dev->flags & (EIR_LIM_DISC | EIR_GEN_DISC))) {
+			g_free(alias);
 			return;
+		}
 
 		dev->legacy = FALSE;
 
-- 
1.7.12

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