Fix a handful of small one-time memory leaks in vbackup,

and one per-package memory leak (in writethread).
This commit is contained in:
rsc 2006-10-19 21:58:59 +00:00
parent 067d852abe
commit 6fc7da3c52
17 changed files with 94 additions and 13 deletions

View file

@ -59,12 +59,15 @@ _vtrpc(VtConn *z, Packet *p, VtFcall *tx)
if(top == buf){
werrstr("first two bytes must be in same packet fragment");
packetfree(p);
vtfree(r);
return nil;
}
top[1] = tag;
qunlock(&z->lk);
if(vtsend(z, p) < 0)
if(vtsend(z, p) < 0){
vtfree(r);
return nil;
}
qlock(&z->lk);
/* wait for the muxer to give us our packet */
@ -85,6 +88,7 @@ _vtrpc(VtConn *z, Packet *p, VtFcall *tx)
if((p = vtrecv(z)) == nil){
werrstr("unexpected eof on venti connection");
z->muxer = 0;
vtfree(r);
return nil;
}
qlock(&z->lk);