xlocale.c: check for allocation failure
PR: 261679 Reported by: phil.stone@gmx.com Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D34140
This commit is contained in:
parent
fcdf9d7de5
commit
b68522308d
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue