From a1a9d26d5b1ffc06f57d5bb61cf0b5012a02084a Mon Sep 17 00:00:00 2001 From: Raquel Medina Date: Fri, 6 Sep 2019 18:22:47 +0200 Subject: re-balance refcount for jresp afb_event_push most recent implementation calls 'json_object_put', thus affecting the reference count for jresp in agl-service-nfc binding. A call to 'json_object_get' has been added to keep jresp available for the binding. SPEC-2800 Signed-off-by: Raquel Medina Change-Id: I6c9f9df8152918dcd70452465352a848eb195f94 --- binding/afm-nfc-binding.c | 1 + 1 file changed, 1 insertion(+) diff --git a/binding/afm-nfc-binding.c b/binding/afm-nfc-binding.c index 5b046f2..72f219f 100644 --- a/binding/afm-nfc-binding.c +++ b/binding/afm-nfc-binding.c @@ -217,6 +217,7 @@ static void record_found(const char *tag_name, void *ptr) pthread_mutex_lock(&mutex); data->jresp = jresp; json_object_object_add(jresp, "uid", json_object_new_string(uid)); + json_object_get(jresp); /* afb_event_push invokes json_object_put */ pthread_mutex_unlock(&mutex); afb_event_push(presence_event, jresp); -- cgit 1.2.3-korg