Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
}
new_field = bt_ctf_field_create(field_type);
- bt_ctf_field_get(new_field);
array->elements->pdata[(size_t)index] = new_field;
end:
if (field_type) {
bt_ctf_field_type_put(field_type);
}
+ if (new_field) {
+ bt_ctf_field_get(new_field);
+ }
return new_field;
}
}
new_field = bt_ctf_field_create(field_type);
- bt_ctf_field_get(new_field);
sequence->elements->pdata[(size_t)index] = new_field;
end:
if (field_type) {
bt_ctf_field_type_put(field_type);
}
+ if (new_field) {
+ bt_ctf_field_get(new_field);
+ }
return new_field;
}