[haiku-commits] Re: r35605 - haiku/trunk/src/system/kernel/slab

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 24 Feb 2010 20:06:04 +0100

On 2010-02-24 at 18:37:00 [+0100], Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> 
wrote:
> ingo_weinhold@xxxxxx wrote:
> >              DepotMagazine* magazine = alloc_magazine(depot, flags);
> > -            if (magazine == NULL)
> > +            if (magazine == NULL) {
> > +                depot->return_object(depot, depot->cookie, object,
> > flags);
> >                  return 0;
> > +            }
> > Log:
> > Don't leak the object when allocating a magazine failed.
> 
> It wasn't leaked -- if object_depot_store() fails (returns 0), the
> caller will keep ownership of the object, and will return it itself
> (now twice, so this should better be reverted).

I see. The comment in object_depot_store() said otherwise.

CU, Ingo

Other related posts: