tlsbwrite() would call checkstate() before calling tlsrecwrite()
to make sure the channel is open. however, because checkstate()
only raises the error, the Block* passed wont be freed and
would result in a memory leak.
move the checkstate() call inside tlsrecwrite() to reuse the
error handling that frees the block on error.
[Authored by Cinap for 9front; DCO ok for Harvey by cross@:
9front uses the MIT license for all changes unless otherwise
noted: http://fqa.9front.org/fqa0.html#0.2.4.4]
tlsbwrite() would call checkstate() before calling tlsrecwrite() to make sure the channel is open. however, because checkstate() only raises the error, the Block* passed wont be freed and would result in a memory leak.
move the checkstate() call inside tlsrecwrite() to reuse the error handling that frees the block on error.
[Authored by Cinap for 9front; DCO ok for Harvey by cross@: 9front uses the MIT license for all changes unless otherwise noted: http://fqa.9front.org/fqa0.html#0.2.4.4]
Signed-off-by: Dan Cross cross@gajendra.net