Zero client/server vchannel handles on error, so that no dangling pointers are left in the structure.
This is done in case vch_read()/vch_write() is accidentally called on not opened vchannel, and some non-zero non-valid leftover pointers (like h->ring) confuse validation logic.
Also validate the ring pointer when checking for opened channel.
Zero client/server vchannel handles on error, so that no dangling pointers are left in the structure.
This is done in case vch_read()/vch_write() is accidentally called on not opened vchannel, and some non-zero non-valid leftover pointers (like h->ring) confuse validation logic.
Also validate the ring pointer when checking for opened channel.