Don't leak the memory we've just malloced if we can't find the
process we're looking for. (I don't think this can currently happen, but it depends how the function is called). PR: 25932 Submitted by: David Xu <davidx@viasoft.com.cn>
This commit is contained in:
parent
17ede005a9
commit
8d8bd0014f
@ -187,10 +187,10 @@ enterpgrp(p, pgid, mksess)
|
||||
*/
|
||||
KASSERT(p->p_pid == pgid,
|
||||
("enterpgrp: new pgrp and pid != pgid"));
|
||||
MALLOC(pgrp, struct pgrp *, sizeof(struct pgrp), M_PGRP,
|
||||
M_WAITOK);
|
||||
if ((np = pfind(savepid)) == NULL || np != p)
|
||||
return (ESRCH);
|
||||
MALLOC(pgrp, struct pgrp *, sizeof(struct pgrp), M_PGRP,
|
||||
M_WAITOK);
|
||||
if (mksess) {
|
||||
register struct session *sess;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user