From owner-dev-commits-src-all@freebsd.org Wed Apr 28 00:12:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8560A6264B2; Wed, 28 Apr 2021 00:12: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 4FVJwV3RRrz3JcP; Wed, 28 Apr 2021 00:12:10 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 68F2F23B7A; Wed, 28 Apr 2021 00:12:10 +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 13S0CA2O021453; Wed, 28 Apr 2021 00:12:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13S0CAQo021452; Wed, 28 Apr 2021 00:12:10 GMT (envelope-from git) Date: Wed, 28 Apr 2021 00:12:10 GMT Message-Id: <202104280012.13S0CAQo021452@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 7452b2e44be6 - stable/12 - libkiconv: address memory leak in not-found cases MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 7452b2e44be687ba2916b1a80fbbe281f3edffb2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 00:12:10 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7452b2e44be687ba2916b1a80fbbe281f3edffb2 commit 7452b2e44be687ba2916b1a80fbbe281f3edffb2 Author: Ed Maste AuthorDate: 2021-04-21 17:45:27 +0000 Commit: Ed Maste CommitDate: 2021-04-28 00:11:42 +0000 libkiconv: address memory leak in not-found cases Found in "Understanding and Detecting Disordered Error Handling with Precise Function Pairing" by Qiushi Wu et al. Reviewed by: imp, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29896 (cherry picked from commit 3cfd08c1c74058451a02bac35307bf7fa509c617) --- lib/libkiconv/kiconv_sysctl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libkiconv/kiconv_sysctl.c b/lib/libkiconv/kiconv_sysctl.c index da68b3011f36..841a162bfd27 100644 --- a/lib/libkiconv/kiconv_sysctl.c +++ b/lib/libkiconv/kiconv_sysctl.c @@ -59,6 +59,7 @@ kiconv_lookupconv(const char *drvname) free(drivers); return (0); } + free(drivers); } return (ENOENT); } @@ -86,6 +87,7 @@ kiconv_lookupcs(const char *tocode, const char *fromcode) return (0); } } + free(csi); } return (ENOENT); }