From 5a4ce2184add0bb173eb0606aca9de38ab246542 Mon Sep 17 00:00:00 2001 From: Jin Yoon Date: Wed, 13 Feb 2019 11:22:45 +0900 Subject: [PATCH] destroy a payload that is not needed anymore Change-Id: I97a2e4c2e5326eb86a836857c0b44eb3b0bc016b --- src/distance-checker.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/distance-checker.c b/src/distance-checker.c index ecf7c3c..c48aebd 100644 --- a/src/distance-checker.c +++ b/src/distance-checker.c @@ -218,6 +218,7 @@ static void update_presence_status(bool status) error = smartthings_payload_set_bool(resp_payload, PROP_VALUE, status); if (error != SMARTTHINGS_RESOURCE_ERROR_NONE) { _E("smartthings_payload_set_bool() failed, [%d]", error); + smartthings_payload_destroy(resp_payload); return; } @@ -225,6 +226,7 @@ static void update_presence_status(bool status) error = smartthings_resource_notify(st_handle, RES_CAPABILITY_PRESENCESENSOR_MAIN_0, resp_payload); if (error != SMARTTHINGS_RESOURCE_ERROR_NONE) { _E("smartthings_resource_notify() failed, [%d]", error); + smartthings_payload_destroy(resp_payload); return; } -- 2.7.4