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

@ -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;
}