I don't think this is needed - free(p) will take a null ptr OK.