Allocation failures can cause lttng_dynamic_buffer_append to fail;
its result should always be checked.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Id1870b1e19d3451afdd1e992355d83d4028b5723
- lttng_dynamic_buffer_append(&message.buffer, &lsm, sizeof(lsm));
+ ret = lttng_dynamic_buffer_append(&message.buffer, &lsm, sizeof(lsm));
+ if (ret) {
+ ret = -LTTNG_ERR_NOMEM;
+ goto end;
+ }
/*
* This is needed to populate the trigger object size for the command
/*
* This is needed to populate the trigger object size for the command
memset(&lsm, 0, sizeof(lsm));
lsm.cmd_type = LTTNG_UNREGISTER_TRIGGER;
memset(&lsm, 0, sizeof(lsm));
lsm.cmd_type = LTTNG_UNREGISTER_TRIGGER;
- lttng_dynamic_buffer_append(&message.buffer, &lsm, sizeof(lsm));
+ ret = lttng_dynamic_buffer_append(&message.buffer, &lsm, sizeof(lsm));
+ if (ret) {
+ ret = -LTTNG_ERR_NOMEM;
+ goto end;
+ }
/*
* This is needed to populate the trigger object size for the command
/*
* This is needed to populate the trigger object size for the command