This commit is contained in:
Olof Hagsand 2019-10-19 20:58:03 +00:00
parent a387c599e2
commit 28a62ecb11
4 changed files with 14 additions and 5 deletions

View file

@ -1392,8 +1392,10 @@ from_client_msg(clicon_handle h,
/* NACM rpc operation exec validation */ /* NACM rpc operation exec validation */
if ((ret = nacm_rpc(rpc, module, username, xnacm, cbret)) < 0) if ((ret = nacm_rpc(rpc, module, username, xnacm, cbret)) < 0)
goto done; goto done;
if (xnacm) if (xnacm){
xml_free(xnacm); xml_free(xnacm);
xnacm = NULL;
}
if (ret == 0) /* Not permitted and cbret set */ if (ret == 0) /* Not permitted and cbret set */
goto reply; goto reply;
} }
@ -1438,6 +1440,8 @@ from_client_msg(clicon_handle h,
retval = 0; retval = 0;
done: done:
clicon_debug(1, "%s retval:%d", __FUNCTION__, retval); clicon_debug(1, "%s retval:%d", __FUNCTION__, retval);
if (xnacm)
xml_free(xnacm);
if (xret) if (xret)
xml_free(xret); xml_free(xret);
if (xt) if (xt)

View file

@ -270,10 +270,12 @@ backend_accept_client(int fd,
#else #else
#error "Need getsockopt O_PEERCRED or getpeereid for unix socket peer cred" #error "Need getsockopt O_PEERCRED or getpeereid for unix socket peer cred"
#endif #endif
if (name && (ce->ce_username = strdup(name)) == NULL){ if (name != NULL){
if ((ce->ce_username = strdup(name)) == NULL){
clicon_err(OE_UNIX, errno, "strdup"); clicon_err(OE_UNIX, errno, "strdup");
goto done; goto done;
} }
}
break; break;
case AF_INET: /* XXX: HACK ce->ce_pid */ case AF_INET: /* XXX: HACK ce->ce_pid */
ce->ce_pid = 0; ce->ce_pid = 0;

View file

@ -232,6 +232,9 @@ wait_restconf(){
err "restconf timeout $RCWAIT seconds" err "restconf timeout $RCWAIT seconds"
fi fi
done done
if [ $valgrindtest -eq 3 ]; then
sleep 2 # some problems with valgrind
fi
} }
# Increment test number and print a nice string # Increment test number and print a nice string

View file

@ -36,7 +36,7 @@ memonce(){
valgrindtest=3 # This means backend valgrind test valgrindtest=3 # This means backend valgrind test
sudo chmod 660 $valgrindfile sudo chmod 660 $valgrindfile
sudo chown www-data $valgrindfile sudo chown www-data $valgrindfile
: ${RCWAIT:=10} # valgrind backend needs some time to get up : ${RCWAIT:=15} # valgrind backend needs some time to get up
clixon_restconf="/usr/bin/valgrind --leak-check=full --show-leak-kinds=all --suppressions=./valgrind-clixon.supp --track-fds=yes --trace-children=no --child-silent-after-fork=yes --log-file=$valgrindfile /www-data/clixon_restconf" clixon_restconf="/usr/bin/valgrind --leak-check=full --show-leak-kinds=all --suppressions=./valgrind-clixon.supp --track-fds=yes --trace-children=no --child-silent-after-fork=yes --log-file=$valgrindfile /www-data/clixon_restconf"
;; ;;