diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-10-22 21:59:52 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-10-22 21:59:52 +0200 |
commit | 22c758478072c9323fce68dd076efdb8213f5c61 (patch) | |
tree | f60261bbb28ab52670d3c879fed4dba7713c6484 /sys/src/9/port/devproc.c | |
parent | 6680d50d4bf09ef2fe11dd433be4db8db9c40b29 (diff) |
devproc: fix another channel leak, move the cclose(c) from proctext() to procopen.
Diffstat (limited to 'sys/src/9/port/devproc.c')
-rw-r--r-- | sys/src/9/port/devproc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/src/9/port/devproc.c b/sys/src/9/port/devproc.c index 6f60c1d0f..16cff7d8e 100644 --- a/sys/src/9/port/devproc.c +++ b/sys/src/9/port/devproc.c @@ -393,6 +393,7 @@ procopen(Chan *c, int omode) tc->offset = 0; qunlock(&p->debug); poperror(); + cclose(c); return tc; case Qproc: @@ -1203,12 +1204,13 @@ proctext(Chan *c, Proc *p) error(Eprocdied); } - if(p->pid != PID(c->qid)) + if(p->pid != PID(c->qid)) { + cclose(tc); error(Eprocdied); + } unlock(i); poperror(); - cclose(c); return tc; } |