libventi: handle nil connection in rpc as error instead of crashing (from sources)

front
cinap_lenrek 2013-01-25 14:19:18 +01:00
parent 0c4d5b8b07
commit 9888ead042
1 changed files with 7 additions and 0 deletions

View File

@ -37,6 +37,13 @@ _vtrpc(VtConn *z, Packet *p, VtFcall *tx)
uchar tag, buf[2], *top;
Rwait *r, *rr;
if(z == nil){
werrstr("not connected");
packetfree(p);
return nil;
}
/* must malloc because stack could be private */
r = vtmallocz(sizeof(Rwait));