Add more malloc() validation