summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2019-05-05 19:54:35 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2019-05-05 19:55:51 -0700
commit2d0a8a4c1ed22b51451bceb20f17d4e69467c2ff (patch)
tree0d69752ddac19a3e4cc71aaf7355946865532fc4
parent91e1d0697da98971ab6375bfd745ed158b7b7185 (diff)
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 <matt.ranostay@konsulko.com>
-rw-r--r--binding/bluetooth-map-api.c6
1 files changed, 4 insertions, 2 deletions
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)