summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--signal-composer-binding/signal-composer-binding.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/signal-composer-binding/signal-composer-binding.cpp b/signal-composer-binding/signal-composer-binding.cpp
index b28d8ec..9009162 100644
--- a/signal-composer-binding/signal-composer-binding.cpp
+++ b/signal-composer-binding/signal-composer-binding.cpp
@@ -212,9 +212,14 @@ void list(afb_req_t request)
{json_object_array_add(allSignalsJ, sig->toJSON());}
if(json_object_array_length(allSignalsJ))
- {afb_req_success(request, allSignalsJ, NULL);}
+ {
+ afb_req_success(request, allSignalsJ, NULL);
+ }
else
- {afb_req_fail(request, "error", "No Signals recorded so far");}
+ {
+ json_object_put(allSignalsJ);
+ afb_req_fail(request, "error", "No Signals recorded so far");
+ }
}
/// @brief entry point for get requests.