The first was found by Coverity:
>>> CID
1681637: Incorrect expression (IDENTICAL_BRANCHES)
>>> The same code is executed when the condition "ret != 0" is
true or false, because the code in the if-then branch and
after the if statement is identical. Should the if statement
be removed?
The second and third are also obvious.
Sorry, missed these in review.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Signed-off-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Mon Feb 23 08:43:29 UTC 2026 on atb-devel-224
}
ret = json_object_set(parent_obj, "flags", flags_map);
- if (ret != 0) {
- goto done;
- }
done:
json_decref(flags_map);
return (ret == 0) ? 0 : 1;
goto done;
}
ret = json_object_set(root_object, "node_status", nodemap_obj);
- if (ret != 0) {
- goto done;
- }
done:
json_decref(nodes_obj);
json_decref(nodemap_obj);
goto done;
}
ret = json_object_set(root_object, "vnn_status", vnnmap_obj);
- if (ret != 0) {
- goto done;
- }
done:
json_decref(gen_value);
json_decref(vnn_lst);