From nobody Wed Feb 09 00:48:08 2022 X-Original-To: dev-commits-src-all@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 9314119B7203; Wed, 9 Feb 2022 00:48:10 +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 4Jth7Y50prz4tdn; Wed, 9 Feb 2022 00:48:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644367690; 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=dQAa+zpW0WKQXxYlecY8kCDqOLQQtkMj8Svk9B71PRo=; b=CgTb6KvwjgKmVvcuD9Xcxt+1W7jHIJ4DbZ8kNgpizOcRJXlxEtmc8g1WTyAikAr997NsiQ F7VRRIg4mq6lbYU/UDP6XS60N8hyNjWZEAvMirzpLWqZq9cciekBHo4To+0L7zL4XBbkrf /CnWJasGbnmBCEcFyhUY4QVZftkavKvuc8mxzkA24bwdCbvcYhvJXbutUZZedSmgltli7g 1OnXlDle8XDNTu/XMcodtGCE94s0zVvmTLaFEbKlboje3v4+w1c7U47kzcUrlxQAXdgBdB xCtg6SLmkhM5FY58AINM1C5P3/U8pNpb6dqqnussKwWoXGZx9rQebkegmxgvHw== 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 E1F3723833; Wed, 9 Feb 2022 00:48:08 +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 2190m8uq083731; Wed, 9 Feb 2022 00:48:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2190m81A083730; Wed, 9 Feb 2022 00:48:08 GMT (envelope-from git) Date: Wed, 9 Feb 2022 00:48:08 GMT Message-Id: <202202090048.2190m81A083730@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e1c53fc8e154 - stable/13 - xlocale.c: only call init_key() when locale was successfully allocated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: e1c53fc8e15491d03641736e07c743fcb4324b2f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644367690; 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=dQAa+zpW0WKQXxYlecY8kCDqOLQQtkMj8Svk9B71PRo=; b=Ouq2QqvBQNLAGotGsTDHf5k60pGkTCmKnpCBBjL9cvKNru8kAnBo+ns2G1gicOarnAkKim tpQ0XyFkv3YZxwbJZOh6jDwLJaUszp4tcppOydzgP4TtEpEzsf+5NEONZyYvsSrgUcghAq ASBos6HMhVESfgUZEpDPI9ZX1Z4nwKauASWI7EH3FU4D4URh3ADn3aTMWcmPpdQTe9pvYD F9PEcORQemyfWGY4x7c44py86Hr/6lO8H3ECakF/OoSKMiZFk31qDn8ZidIIEAe2fNdv+X fbM0bvj7cf6U400wF5uE0c8Y8OCvyWp/GkdgSCaJM96PXTRee+PTQ6nbreO1tg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644367690; a=rsa-sha256; cv=none; b=efZzIq7ZuMY0tQW2TEKVFoYfk4KIswn2C3LbTuwthiD0KPq1oT1QygNvQyVr0wumqGO73B oCrQmwJlkVnydNyvUe3/0xtQpYE96MYikbh6nSWdZB0XmHD+TYY4ti4SYmcOfPU/bzz1JF 3HIvAYet8EujpoNsNmX6dvJBLYtyctaY/l+zQExvbJspsg2h+Z9QrwTzjYlQivd4qnvBSN 2GOYFA0crcmfmaT4SRHniTjRbrJZg/oxUMRJvWhvI+kp5TYoKijDeCwDsNRo1o5FZVhSgS HUZio4VPGMeJCxisbE8Zzs3lVDCnwpGP+wcaq3J4OYcCypULfDoKgTTZARClOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e1c53fc8e15491d03641736e07c743fcb4324b2f commit e1c53fc8e15491d03641736e07c743fcb4324b2f Author: Konstantin Belousov AuthorDate: 2022-02-02 17:25:45 +0000 Commit: Konstantin Belousov CommitDate: 2022-02-09 00:42:45 +0000 xlocale.c: only call init_key() when locale was successfully allocated (cherry picked from commit 7bf532c9d447bfdf03f42a5c5092fb74740722b2) --- lib/libc/locale/xlocale.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libc/locale/xlocale.c b/lib/libc/locale/xlocale.c index 467d6e6e5aee..4bddc43c086b 100644 --- a/lib/libc/locale/xlocale.c +++ b/lib/libc/locale/xlocale.c @@ -257,13 +257,13 @@ newlocale(int mask, const char *locale, locale_t base) int useenv = 0; int success = 1; - _once(&once_control, init_key); - locale_t new = alloc_locale(); if (NULL == new) { return (NULL); } + _once(&once_control, init_key); + orig_base = base; FIX_LOCALE(base); copyflags(new, base); @@ -312,12 +312,12 @@ duplocale(locale_t base) locale_t new = alloc_locale(); int type; - _once(&once_control, init_key); - if (NULL == new) { return (NULL); } + _once(&once_control, init_key); + FIX_LOCALE(base); copyflags(new, base);