diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-12-21 13:49:34 +0100 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-12-21 13:52:40 +0100 |
commit | ecba1bf8a0ba238af78fa24a46c66d90905f8d0d (patch) | |
tree | 0152920bf597506240fbb62f77d77d6f71496f95 /signal-composer-binding/signal.cpp | |
parent | 6ba79ffb113863d8df294729b16db4f4622fe283 (diff) |
Don't segfault at exit pointed to freed objects
Change-Id: Ic2f8ebee552ce982f858fe6ee93db2508a290617
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'signal-composer-binding/signal.cpp')
-rw-r--r-- | signal-composer-binding/signal.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/signal-composer-binding/signal.cpp b/signal-composer-binding/signal.cpp index dcbf814..84be8a7 100644 --- a/signal-composer-binding/signal.cpp +++ b/signal-composer-binding/signal.cpp @@ -75,9 +75,8 @@ Signal::Signal(const std::string& id, Signal::~Signal() { - json_object_put(onReceived_->argsJ); - json_object_put(getSignalsArgs_); - delete(onReceived_); + if(getSignalsArgs_) json_object_put(getSignalsArgs_); + if(onReceived_) delete(onReceived_); } Signal::operator bool() const |