Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Feb 2022 00:48:11 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: a0f1e4c5caef - stable/13 - __collate_load(): check for calloc failure
Message-ID:  <202202090048.2190mB3t083779@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 
 	/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202202090048.2190mB3t083779>