Date: Thu, 3 Feb 2022 02:49:33 GMT From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: bc9ce839f981 - main - __messages_load(): check for calloc() failure Message-ID: <202202030249.2132nXRF087110@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bc9ce839f9811ee9e3990bb26c00031a84fa50bd commit bc9ce839f9811ee9e3990bb26c00031a84fa50bd Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2022-02-02 18:07:42 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2022-02-03 01:03:24 +0000 __messages_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 --- lib/libc/locale/lmessages.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libc/locale/lmessages.c b/lib/libc/locale/lmessages.c index fd00fc16a4ea..70de30650346 100644 --- a/lib/libc/locale/lmessages.c +++ b/lib/libc/locale/lmessages.c @@ -101,6 +101,8 @@ __messages_load(const char *name, locale_t l) { struct xlocale_messages *new = calloc(sizeof(struct xlocale_messages), 1); + if (new == NULL) + return (NULL); new->header.header.destructor = destruct_messages; if (messages_load_locale(new, &l->using_messages_locale, name) == _LDP_ERROR) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202202030249.2132nXRF087110>