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

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 24 Feb 2010 18:37:00 +0100

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).

Bye,
   Axel.


Other related posts: