[lxc-devel] strdup return value

Daniel Lezcano daniel.lezcano at free.fr
Thu Nov 19 09:37:48 UTC 2009


Michael Tokarev wrote:
> I wodner why all code checks for malloc return value
> but almost no places checks for strdup.
>
> Maybe it is better idea to define xmalloc()/xstrdup()
> that aborts if memory allocation failed, instead of
> scattering error checking all over?
>
> Note that after the container is running, there's almost
> no memory allocations anymore, so it wont fail while
> everything is running.
>   
Isn't this done with libiberty ?

http://gcc.gnu.org/onlinedocs/libiberty/Memory-Allocation.html#Memory-Allocation





More information about the lxc-devel mailing list