xlocale.c: check for allocation failure

PR:	261679

(cherry picked from commit b68522308d)
This commit is contained in:
Konstantin Belousov 2022-02-02 19:24:42 +02:00
parent 236a826c14
commit 3e4e8d5cbf

View file

@ -198,6 +198,9 @@ alloc_locale(void)
{
locale_t new = calloc(sizeof(struct _xlocale), 1);
if (new == NULL)
return (NULL);
new->header.destructor = destruct_locale;
new->monetary_locale_changed = 1;
new->numeric_locale_changed = 1;