fix some malloc's