summaryrefslogtreecommitdiffstats
path: root/signal-composer-binding/signal-composer-binding.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-12-08 20:10:48 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-12-14 11:00:49 +0100
commitc4b36f01f3286a1c7f183323df00b36270c8498b (patch)
tree93bcc0c3956d161c80067cf5903f43c53be252a1 /signal-composer-binding/signal-composer-binding.cpp
parente599b4ba129df475a9c8bb8290c3803f9dda664a (diff)
Fix memory leaks relative to json_object
Change-Id: I0cff16c1d44b9363522fde7c6c9b2bd10ba376ac Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'signal-composer-binding/signal-composer-binding.cpp')
-rw-r--r--signal-composer-binding/signal-composer-binding.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/signal-composer-binding/signal-composer-binding.cpp b/signal-composer-binding/signal-composer-binding.cpp
index 9a113d5..55c11fe 100644
--- a/signal-composer-binding/signal-composer-binding.cpp
+++ b/signal-composer-binding/signal-composer-binding.cpp
@@ -178,16 +178,19 @@ void loadConf(afb_req request)
if( sourcesJ && composer.loadSources(sourcesJ))
{
afb_req_fail_f(request, "Loading 'sources' configuration or subscription error", "Error code: -1");
+ json_object_put(fileJ);
return;
}
if(signalsJ && composer.loadSignals(signalsJ))
{
afb_req_fail_f(request, "Loading 'signals' configuration or subscription error", "Error code: -1");
+ json_object_put(fileJ);
return;
}
else
{composer.initSignals();}
+ json_object_put(fileJ);
afb_req_success(request, NULL, NULL);
}