summaryrefslogtreecommitdiffstats
path: root/signal-composer-binding/source.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/source.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/source.cpp')
-rw-r--r--signal-composer-binding/source.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/signal-composer-binding/source.cpp b/signal-composer-binding/source.cpp
index 9e10e65..830f799 100644
--- a/signal-composer-binding/source.cpp
+++ b/signal-composer-binding/source.cpp
@@ -112,12 +112,14 @@ void SourceAPI::makeSubscription()
AFB_ERROR("Error building JSON query object to subscribe to for signal %s", sig.second->id().c_str());
break;
}
- source.uid = sig.second->id().c_str();
+ source.uid = sig.first.c_str();
source.context = (void*)sig.second->get_context();
ActionExecOne(&source, getSignals_, signalJ);
// Considerate signal subscribed no matter what
sig.second->subscribed_ = true;
+ delete(source.context);
}
+ source.uid = "";
ActionExecOne(&source, getSignals_, nullptr);
}
}