Found by Coverity:
2. returned_null: bt_ctf_field_type_variant_get_tag_name returns null
(checked 4 out of 5 times).
3. var_assigned: Assigning: pathstr = null return value from
bt_ctf_field_type_variant_get_tag_name.
CID
1376176 (#1 of 1): Dereference null return value (NULL_RETURNS).
dereference: Dereferencing a pointer that might be null pathstr when
calling pathstr_to_field_path.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ if (!pathstr) {
+ BT_LOGW_STR("Cannot get path string.");
+ ret = -1;
+ goto end;
+ }
+
/* Get target field path out of path string */
target_field_path = pathstr_to_field_path(pathstr, ctx);
if (!target_field_path) {
/* Get target field path out of path string */
target_field_path = pathstr_to_field_path(pathstr, ctx);
if (!target_field_path) {