diff options
author | cinap_lenrek <cinap_lenrek@centraldogma> | 2011-11-16 22:15:31 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@centraldogma> | 2011-11-16 22:15:31 +0100 |
commit | 2dcdfb0d331dfd4633dd45dbdc382567de1e977e (patch) | |
tree | 5a0579f540d7ee757c6e8838bde1ef76581ce3fe /sys/src/cmd/webfs | |
parent | e6d455a3e6847b52c5fb901e1636f207ffe7ced7 (diff) |
webfs: more leaks
Diffstat (limited to 'sys/src/cmd/webfs')
-rw-r--r-- | sys/src/cmd/webfs/client.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sys/src/cmd/webfs/client.c b/sys/src/cmd/webfs/client.c index 26ce28350..bd80da4a7 100644 --- a/sys/src/cmd/webfs/client.c +++ b/sys/src/cmd/webfs/client.c @@ -94,10 +94,10 @@ clientbodyopen(Client *c, Req *r) fprint(2, "try %s\n", c->url->url); if(c->url->open(c, c->url) < 0){ Error: + rerrstr(e, sizeof e); if(next) fprint(2, "next %s (but for error)\n", next); free(next); - rerrstr(e, sizeof e); c->iobusy = 0; if(r != nil) r->fid->omode = -1; @@ -106,12 +106,18 @@ clientbodyopen(Client *c, Req *r) respond(r, e); return; } - if (c->authenticate && nauth++ < 1) - continue; - if(!c->redirect) - break; + free(next); next = c->redirect; c->redirect = nil; + if(c->authenticate && nauth++ < 1){ + if(c->url->close) + (*c->url->close)(c); + free(next); + next = nil; + continue; + } + if(next == nil) + break; if(i==c->ctl.redirectlimit){ werrstr("redirect limit reached"); goto Error; |