Skip to content

Commit

Permalink
Merge pull request #15133 from LabNConsulting/chopps/coverity-fixes
Browse files Browse the repository at this point in the history
lib: fix coverity issues
  • Loading branch information
ton31337 authored Jan 12, 2024
2 parents 20d0d47 + 29f2a30 commit d2c275a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
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); \
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

0 comments on commit d2c275a

Please sign in to comment.