From: Jérémie Galarneau Date: Wed, 18 Nov 2020 22:12:45 +0000 (-0500) Subject: Fix: trigger: erroneous check for success of trigger creation X-Git-Tag: v2.13.0-rc1~419 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f5d98ed9e6017de4d7146fd4a19dad4dab5471e3;p=lttng-tools.git Fix: trigger: erroneous check for success of trigger creation 6808ef55e added a check for `ret == 0` to determine if a trigger could be created from a payload. The function returns >= 0 on success, leading to crashes when a trigger is de-serialized. Signed-off-by: Jérémie Galarneau Change-Id: Icd769dcb04f7637aa1877436e9a5570e7f20b63b --- diff --git a/src/common/trigger.c b/src/common/trigger.c index e69e72e07..e038fa81a 100644 --- a/src/common/trigger.c +++ b/src/common/trigger.c @@ -264,7 +264,7 @@ error: lttng_condition_put(condition); lttng_action_put(action); end: - if (ret == 0) { + if (ret >= 0) { *_trigger = trigger; } else { lttng_trigger_put(trigger);