summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsaman <mahmoudi.saman1@gmail.com>2021-01-27 14:13:08 +0330
committersaman <mahmoudi.saman1@gmail.com>2021-02-02 12:01:38 +0330
commitce5000f42dbfa854096a6e8c9da34d48ed04ef31 (patch)
tree81bb4c87b7e85d1745d73a268fe86164ad3c958e
parentb4ebff5a25cf1346b9ea86379a8d25275bb64a32 (diff)
Fixing double free memory
Bug-AGL: SPEC-3785 Change-Id: I792bac4fe96228840eb5d43abdc4a364d2127207 Signed-off-by: saman <mahmoudi.saman1@gmail.com>
-rw-r--r--binding/bluetooth-api.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/binding/bluetooth-api.c b/binding/bluetooth-api.c
index 49ae4e7..8a9945a 100644
--- a/binding/bluetooth-api.c
+++ b/binding/bluetooth-api.c
@@ -1381,11 +1381,8 @@ static void bluetooth_avrcp_controls(afb_req_t request)
if (device) {
/* TODO: handle multiple players per device */
jval = bluez_get_property(ns, BLUEZ_AT_MEDIACONTROL, device, FALSE, "Player", NULL);
- if (jval) {
+ if (jval)
player = (gchar *)json_object_get_string(jval);
- json_object_put(jval);
- jval = NULL;
- }
if (!player)
player = g_strconcat(device, "/", BLUEZ_DEFAULT_PLAYER, NULL);
g_free(device);