Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Feb 2022 00:48:19 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: a6ba681b44d7 - stable/13 - __ctype_load(): check for calloc() failure
Message-ID:  <202202090048.2190mJOg083975@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=a6ba681b44d7048c69d54f9cc8ed57c8b46c912b

commit a6ba681b44d7048c69d54f9cc8ed57c8b46c912b
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2022-02-02 18:17:58 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2022-02-09 00:42:46 +0000

    __ctype_load(): check for calloc() failure
    
    (cherry picked from commit ef061a2e2978a5e0fbfe2766ff7ab8f529bbd966)
---
 lib/libc/locale/setrunelocale.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/libc/locale/setrunelocale.c b/lib/libc/locale/setrunelocale.c
index 551d32b7ab6a..41c82e637529 100644
--- a/lib/libc/locale/setrunelocale.c
+++ b/lib/libc/locale/setrunelocale.c
@@ -214,6 +214,8 @@ void *
 __ctype_load(const char *locale, locale_t unused __unused)
 {
 	struct xlocale_ctype *l = calloc(sizeof(struct xlocale_ctype), 1);
+	if (l == NULL)
+		return (NULL);
 
 	l->header.header.destructor = destruct_ctype;
 	if (__setrunelocale(l, locale)) {



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