Replace if (p) free (p) by just free (p)