Fixes after coverity analysis

This commit is contained in:
Olof hagsand 2023-12-30 16:04:06 +01:00
parent 7b58c1c562
commit 0fff9d8ef5
13 changed files with 43 additions and 24 deletions

View file

@ -1596,7 +1596,7 @@ cli_kill_session(clixon_handle h,
goto done;
}
if ((str = cv_string_get(cvec_i(argv, 0))) != NULL){
if ((ret = parse_uint32(str, &session_id, NULL)) < 0)
if ((ret = parse_uint32(str, &session_id, &reason)) < 0)
goto done;
if (ret == 0){
cligen_output(stderr, "%s\n", reason);

View file

@ -372,7 +372,6 @@ api_data_pagination(clixon_handle h,
cxobj *xp;
cxobj *xpr = NULL;
yang_stmt *y = NULL;
cbuf *cbrpc = NULL;
int32_t depth = -1; /* Nr of levels to print, -1 is all, 0 is none */
uint32_t limit = 0;
uint32_t offset = 0;
@ -568,8 +567,6 @@ api_data_pagination(clixon_handle h,
retval = 0;
done:
clixon_debug(CLIXON_DBG_DEFAULT, "%s retval:%d", __FUNCTION__, retval);
if (cbrpc)
cbuf_free(cbrpc);
if (xpath)
free(xpath);
if (nsc)

View file

@ -1195,7 +1195,7 @@ snmp_oid2str(oid **oidi,
break;
}
if (cbuf_len(enc)){
if (cv_string_set(cv, cbuf_get(enc)) < 0){
if (cv_string_set(cv, cbuf_get(enc)) == NULL){
clixon_err(OE_UNIX, errno, "cv_string_set");
goto done;
}
@ -1311,7 +1311,7 @@ snmp_xmlkey2val_oid(cxobj *xentry,
break;
if (cvk_val){
cv = cvec_i(*cvk_val, i);
if (cv_string_set(cv, xml_body(xi)) < 0){
if (cv_string_set(cv, xml_body(xi)) == NULL){
clixon_err(OE_UNIX, errno, "cv_string_set");
goto done;
}