Fix valgrind error in c_test