Forgot to check 2 malloc() calls for errors.