summaryrefslogtreecommitdiff
path: root/sys/src/9/port/devproc.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2012-10-22 21:59:52 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2012-10-22 21:59:52 +0200
commit22c758478072c9323fce68dd076efdb8213f5c61 (patch)
treef60261bbb28ab52670d3c879fed4dba7713c6484 /sys/src/9/port/devproc.c
parent6680d50d4bf09ef2fe11dd433be4db8db9c40b29 (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.c6
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;
}