you're leaking memory here since you assign to the pointer below.