From owner-svn-src-all@freebsd.org Sun Oct 29 12:07:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2FFDE620F4; Sun, 29 Oct 2017 12:07:28 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FCD9778A3; Sun, 29 Oct 2017 12:07:28 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9TC7Rbh042413; Sun, 29 Oct 2017 12:07:27 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9TC7R1f042412; Sun, 29 Oct 2017 12:07:27 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201710291207.v9TC7R1f042412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 29 Oct 2017 12:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325102 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 325102 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Oct 2017 12:07:28 -0000 Author: trasz Date: Sun Oct 29 12:07:27 2017 New Revision: 325102 URL: https://svnweb.freebsd.org/changeset/base/325102 Log: Plug memory leak on error case. Reported by: Coverity CID: 1382112 MFC after: 2 weeks Modified: head/libexec/rtld-elf/libmap.c Modified: head/libexec/rtld-elf/libmap.c ============================================================================== --- head/libexec/rtld-elf/libmap.c Sun Oct 29 12:03:06 2017 (r325101) +++ head/libexec/rtld-elf/libmap.c Sun Oct 29 12:07:27 2017 (r325102) @@ -133,6 +133,7 @@ lmc_parse_file(char *path) retval = read(fd, lm_map, st.st_size); if (retval != st.st_size) { close(fd); + free(lm_map); dbg("lm_parse_file: read(\"%s\") failed, %s", path, rtld_strerror(errno)); return;