end{pw,sp}ent() can only be called after get{pw,sp}ent()

Calling them unconditionally can result in memory corruption.