The return value of malloc() should be checked, even if it's highly unlikely that it will fail. Furthermore, a return value of 0 indicates that the function failed.