From 2d0a8a4c1ed22b51451bceb20f17d4e69467c2ff Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Sun, 5 May 2019 19:54:35 -0700 Subject: binding: bluetooth-map: add missing g_variant_unref() in map_request_message() To avoid memory leaks g_variant_unref() needs to be called on bluez_call() replies. Bug-AGL: SPEC-2351 Change-Id: Ia595093ac479b884ca4793a96c97d58e4eca2959 Signed-off-by: Matt Ranostay --- binding/bluetooth-map-api.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'binding/bluetooth-map-api.c') diff --git a/binding/bluetooth-map-api.c b/binding/bluetooth-map-api.c index 798c9fa..d05709e 100644 --- a/binding/bluetooth-map-api.c +++ b/binding/bluetooth-map-api.c @@ -124,9 +124,11 @@ static void unsubscribe(afb_req_t request) static void map_request_message(struct map_state *ns, const gchar *path) { - GVariant *params = + GVariant *reply, *params = g_variant_new("(&sb)", "", g_variant_new_boolean(FALSE)); - bluez_call(ns, BLUEZ_AT_MESSAGE, path, "Get", params, NULL); + reply = bluez_call(ns, BLUEZ_AT_MESSAGE, path, "Get", params, NULL); + if (reply) + g_variant_unref(reply); } static void map_notification_event(struct map_state *ns, gchar *filename) -- cgit 1.2.3-korg