bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] Check malloc result in getopt_long


From: Tobias Stoeckmann
Subject: Re: [PATCH] Check malloc result in getopt_long
Date: Mon, 16 Feb 2015 22:55:40 +0100

On Mon, Feb 16, 2015 at 08:57:00PM +0000, Pádraig Brady wrote:
> I'm not sure it's generally worth proceeding in OOM conditions
> unless there are clear fall backs.  It would be nice to depend on xalloc
> and just call xmalloc(). Could this suffice?
> 
>   #ifdef _LIBC
>   struct option_list *newp = alloca (sizeof (*newp));
>   #else
>   struct option_list *newp = xmalloc (sizeof (*newp));
>   #endif

Yeah, I am fine with that solution.
Didn't think about simply using xmalloc there. Maybe it was too easy. :)


Tobias



reply via email to

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