__monetary_load(): check for calloc() failure
Noted and 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
0fed1e6f18
commit
4d3b84f67c
@ -162,6 +162,8 @@ __monetary_load(const char *name, locale_t l)
|
||||
{
|
||||
struct xlocale_monetary *new = calloc(sizeof(struct xlocale_monetary),
|
||||
1);
|
||||
if (new == NULL)
|
||||
return (NULL);
|
||||
new->header.header.destructor = destruct_monetary;
|
||||
if (monetary_load_locale_l(new, &l->using_monetary_locale,
|
||||
&l->monetary_locale_changed, name) == _LDP_ERROR) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user