- notification_append_capture(¬if, &output);
- else
- notification_append_empty_capture(¬if);
+ ret = notification_append_capture(¬if, &output);
+ if (ret || !validate_buffer_len(¬if, captures_left)) {
+ /*
+ * On append capture error or if the generated
+ * buffer data would not leave enough room to
+ * write empty capture fields for the remaining
+ * fields, skip the field capture by restoring
+ * the msgpack writer position and writing an
+ * empty capture field.
+ */
+ lttng_msgpack_restore_writer_pos(¬if.writer, save_pos);
+ ret = notification_append_empty_capture(¬if);
+ if (ret)
+ CRIT("Not enough space for empty capture field\n");
+ }