From 1578465911e42c6aae2e267b3ef104527a4125f8 Mon Sep 17 00:00:00 2001 From: Vinicius Costa Gomes Date: Fri, 24 Aug 2012 20:51:38 -0300 Subject: [PATCH] core: Fix memory leak 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 b642e37bb..532fcddfc 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; -- 2.47.3