[PATCH] _nl_load_domain: Use calloc instead of alloca

Florian Weimer fweimer@redhat.com
Wed Jun 21 21:11:00 GMT 2017


On 06/21/2017 09:53 PM, Adhemerval Zanella wrote:
> 
> 
> On 19/06/2017 13:18, Florian Weimer wrote:
>> 2017-06-19  Florian Weimer  <fweimer@redhat.com>
>>
>> 	* intl/loadmsgcat.c: Remove alloca support.
>> 	(_nl_load_domain): Use calloc instead of alloca.
> 
> LGTM, thanks.

Thanks, I pushed it with a small change:

-               sysdep_segment_values =
-                 (const char **)
-                 alloca (n_sysdep_segments * sizeof (const char *));
+               sysdep_segment_values = calloc
+                 (n_sysdep_segments, sizeof (const char *));
+               if (sysdep_segment_values == NULL)
+                 goto invalid;

(The calloc return value check is new.)

Florian



More information about the Libc-alpha mailing list