git: a0f1e4c5caef - stable/13 - __collate_load(): check for calloc failure
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 09 Feb 2022 00:48:11 UTC
The branch stable/13 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=a0f1e4c5caef4974a798aae2a4c244a7eb96f568
commit a0f1e4c5caef4974a798aae2a4c244a7eb96f568
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2022-02-02 18:01:56 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2022-02-09 00:42:45 +0000
__collate_load(): check for calloc failure
(cherry picked from commit b8ad908ad98a6f2d8ffff979c2abb7895c55a82b)
---
lib/libc/locale/collate.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/libc/locale/collate.c b/lib/libc/locale/collate.c
index 4365334322cd..2f0e2003aa45 100644
--- a/lib/libc/locale/collate.c
+++ b/lib/libc/locale/collate.c
@@ -90,6 +90,8 @@ __collate_load(const char *encoding, __unused locale_t unused)
}
struct xlocale_collate *table = calloc(sizeof(struct xlocale_collate),
1);
+ if (table == NULL)
+ return (NULL);
table->header.header.destructor = destruct_collate;
/*