bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: memory leak in dir-lookup found


From: Roland McGrath
Subject: Re: memory leak in dir-lookup found
Date: Wed, 28 Mar 2001 15:29:34 -0500 (EST)

> > Note that make_protid should check for a null pointer and treat it as
> > ENOMEM.
> 
> Uhm. There is a problem with that: Some callers (boot-start.c.
> init-startup.c) pass a 0 to make finish_protid to create a iouser for root.

Well, if those are the only places, i.e. that is only ever used for a
couple of bootstrapping calls and never while running later, then we should
take out that behavior.  Those places can just construct a root iouser and
pass it in.  As it is now, it fails to check for errors (ENOMEM is the only
possibility) and when allocation fails it will store null pointers and
probably crash later on.

Perhaps iohelp should have a convenience function to create an iouser
for root, or any one-uid, one-gid iouser.  Then those two places you
mention would just have iohelp_create_iouser_oneid (0, 0) in their call
to make_protid.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]