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

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: