Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: fix coverity issues #15133

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/darr.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ void *__darr_resize(void *a, uint count, size_t esize, struct memtype *mt);
*/
#define darr_ensure_i_mt(A, I, MT) \
({ \
assert((int)(I) >= 0 && (int)(I) <= INT_MAX); \
assert((int)(I) >= 0 && (uint)(I) <= INT_MAX); \
ton31337 marked this conversation as resolved.
Show resolved Hide resolved
int _i = (int)(I); \
if (_i > darr_maxi(A)) \
_darr_resize_mt((A), _i + 1, MT); \
Expand Down
3 changes: 1 addition & 2 deletions lib/yang.c
Original file line number Diff line number Diff line change
Expand Up @@ -1143,8 +1143,7 @@ LY_ERR yang_lyd_trim_xpath(struct lyd_node **root, const char *xpath)
}
darr_free(remove);

if (set)
ly_set_free(set, NULL);
ly_set_free(set, NULL);

return LY_SUCCESS;
#endif
Expand Down
2 changes: 1 addition & 1 deletion mgmtd/mgmt_fe_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,7 @@ static int fe_adapter_send_tree_data(struct mgmt_fe_session_ctx *session,
uint8_t *buf = NULL;
int ret = 0;

darr_append_n(buf, offsetof(typeof(*msg), result));
darr_append_n(buf, sizeof(*msg));
msg = (typeof(msg))buf;
msg->refer_id = session->session_id;
msg->req_id = req_id;
Expand Down
Loading