Only check status code when valgrind is running
Remove redundant check for null input