9660srv: fix memory leak

cinap_lenrek 2011-06-16 20:04:43 +02:00
parent 158b5a3a21
commit 19fda05a6d
1 changed files with 3 additions and 2 deletions

View File

@ -246,6 +246,7 @@ ealloc(long n)
p = malloc(n); p = malloc(n);
if(p == 0) if(p == 0)
error("no memory"); error("no memory");
setmalloctag(p, getcallerpc(&n));
return p; return p;
} }
@ -365,8 +366,6 @@ rwalk(void)
} }
if(waserror()){ if(waserror()){
if(nf != nil)
xfile(req->newfid, Clunk);
if(rep->nwqid == req->nwname){ if(rep->nwqid == req->nwname){
if(oldlen) if(oldlen)
free(oldptr); free(oldptr);
@ -378,6 +377,8 @@ rwalk(void)
f->ptr = oldptr; f->ptr = oldptr;
f->len = oldlen; f->len = oldlen;
} }
if(nf != nil)
xfile(req->newfid, Clunk);
if(rep->nwqid==req->nwname || rep->nwqid > 0){ if(rep->nwqid==req->nwname || rep->nwqid > 0){
err_msg[0] = '\0'; err_msg[0] = '\0';
return; return;