From nobody Thu Feb 03 02:49:27 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C55B819A0C7C; Thu, 3 Feb 2022 02:49:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Jq36J25fwz4bBC; Thu, 3 Feb 2022 02:49:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643856568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=afefX+tQYCDl3SgLG/pwtuOiurNWg4r8OEhyi4vq6BE=; b=kFQad5814C6ypfCA080v7637uXwkqsyi4gfHF7Gp4qWKfBKItAEdywkUZVz4/BSO4LXanK xawEGeTUJ8wIbxbG0fATf03zJhNWDSKopu0zEaA0l/3abc1bLlZ/96QCbE3+EfzgMaR99B YuW+86Tx0hCvQ3E1nMEx24ASumqvSHJoHW/2apCiNz3sXum3dJQqlSV8aySuiTKf4quNRc EXOxVSEkyuG42Ad5i9S2t+tq1wGX1rJ9PZZ5+0ogWxYmvZow4oJCItZIs8FDdGk9uCUDCU /jt+1jnc39eMlFDa5P97AQBnu55mkCri2OV2RpEhzWxm93xHidHQtTA0FGMXqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0EFD7C7E; Thu, 3 Feb 2022 02:49:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2132nR6G086974; Thu, 3 Feb 2022 02:49:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2132nRsr086973; Thu, 3 Feb 2022 02:49:27 GMT (envelope-from git) Date: Thu, 3 Feb 2022 02:49:27 GMT Message-Id: <202202030249.2132nRsr086973@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: b68522308d1e - main - xlocale.c: check for allocation failure List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b68522308d1e0b19c00d82c13878a693fc2ef2df Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643856568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=afefX+tQYCDl3SgLG/pwtuOiurNWg4r8OEhyi4vq6BE=; b=jMgMhfdY+feXBStlxaUuGEYHr4WyZJxol1c+1+eh2+LicCx/tbGiPQmL4h3Zpiaf/l70Et RZwNlW1ArA6ko+FADqs2ZgHbvzGhYrr8nybMlPIVlzu1NotxUcUoCgwr/N6Cm38OBNuZEt 28LsrhL1hzHxhX8PysCt3rOaLbGt9fiXppf7M5jlkTWqHEz+53y6+T65a0p9XSQ0t0P8gV zgOyU3nh1enXJWuNpwB1e9vNPCKHxrfXYXAa6dE9O2M0Z1J2abqX+xxf9u1Imv/LLelHVn v9ivlvZoDrEMz1IVTCHN/hB80VVM3JJo7WNktn4dRANkAK/04Z9wfk06hsuk2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643856568; a=rsa-sha256; cv=none; b=qh2kuLED4VknEW+w0cVTX4p9iXW4FV7eAvn0pkeMH3eDXkLBXNBNU00l9d84iiPxCe0Nf0 IUTHi4sdck5dLxHVTAMLsOKdApo/XWiUTNa7g+2kmoQ3uiVIwEXNOOI1oKwAwwcKSMI0Bg I4cfmG68ekd+5fDOVW3gqTxKIoGgl54e/MonJd5eYE+/loEUC6NfYkQHvzT+Uz82kiX49s vzpijQg3EKFSvuBqEqSfL94tfxfblB5mzLUTzab4ubAxKgRloUI8Yv/y9n0fVrWNGW7tdU 9hx0H+fm6UTpTTYiW4U4K3EowO/QpeNfRDrVjV+yA8Mh8PitbcGxYh6Iqr1sVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b68522308d1e0b19c00d82c13878a693fc2ef2df commit b68522308d1e0b19c00d82c13878a693fc2ef2df Author: Konstantin Belousov AuthorDate: 2022-02-02 17:24:42 +0000 Commit: Konstantin Belousov CommitDate: 2022-02-03 01:02:58 +0000 xlocale.c: check for allocation failure PR: 261679 Reported by: phil.stone@gmx.com Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D34140 --- lib/libc/locale/xlocale.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/libc/locale/xlocale.c b/lib/libc/locale/xlocale.c index e07568775394..467d6e6e5aee 100644 --- a/lib/libc/locale/xlocale.c +++ b/lib/libc/locale/xlocale.c @@ -198,6 +198,9 @@ alloc_locale(void) { locale_t new = calloc(sizeof(struct _xlocale), 1); + if (new == NULL) + return (NULL); + new->header.destructor = destruct_locale; new->monetary_locale_changed = 1; new->numeric_locale_changed = 1;