fix a use-after-free in htable