summaryrefslogtreecommitdiffstats
path: root/signal-composer-binding/signal.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-12-04 17:28:04 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-12-14 11:00:49 +0100
commiteba541dae4461603e16efc12019c38e87eb4fcb1 (patch)
tree1231c0720df005b791824da9efc6c052962cd0a5 /signal-composer-binding/signal.cpp
parent55e4e3b31f2cbec776eb89c0b780f895fa0f0b86 (diff)
Avoid mem leack, overwriting, initializing variable.
Fix a memory squashing bug that segfault binder when loading directory searching for binding. Change-Id: Iedc6747d8ce49e7ff5fc2013bb7d03b5b553b89c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'signal-composer-binding/signal.cpp')
-rw-r--r--signal-composer-binding/signal.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/signal-composer-binding/signal.cpp b/signal-composer-binding/signal.cpp
index 2af440c..17286f5 100644
--- a/signal-composer-binding/signal.cpp
+++ b/signal-composer-binding/signal.cpp
@@ -142,7 +142,7 @@ json_object* Signal::toJSON() const
struct signalCBT* Signal::get_context()
{
- struct signalCBT* ctx = (struct signalCBT*)calloc (1, sizeof(struct signalCBT));
+ struct signalCBT* ctx = new struct signalCBT;
if(!ctx->searchNsetSignalValue)
{ctx->searchNsetSignalValue = searchNsetSignalValueHandle;}