From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 9668F1395E2 for ; Tue, 15 Nov 2016 03:34:41 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E1407E0B1F; Tue, 15 Nov 2016 03:34:38 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C2B3BE0AF0 for ; Tue, 15 Nov 2016 03:34:38 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AD9693415B7 for ; Tue, 15 Nov 2016 03:34:36 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2224224C1 for ; Tue, 15 Nov 2016 03:34:35 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1479178921.00bd72f7753299b7b4ba8da6d0471bf09f13b09f.vapier@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: qmerge.c X-VCS-Directories: / X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 00bd72f7753299b7b4ba8da6d0471bf09f13b09f X-VCS-Branch: master Date: Tue, 15 Nov 2016 03:34:35 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 62c341ec-af92-495a-b8e8-e7e2db7aed5a X-Archives-Hash: e39c30f4de2960adcfebd4d5efcc2a3e commit: 00bd72f7753299b7b4ba8da6d0471bf09f13b09f Author: Mike Frysinger gentoo org> AuthorDate: Tue Nov 15 03:02:01 2016 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Tue Nov 15 03:02:01 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=00bd72f7 qmerge: fix mem leak w/hash_file calls qmerge.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qmerge.c b/qmerge.c index b734a87..8a5d329 100644 --- a/qmerge.c +++ b/qmerge.c @@ -588,6 +588,7 @@ merge_tree_at(int fd_src, const char *src, int fd_dst, const char *dst, /* syntax: obj filename hash mtime */ hash = hash_file_at(subfd_src, name, HASH_MD5); fprintf(contents, "obj %s %s %"PRIu64"\n", cpath, hash, (uint64_t)st.st_mtime); + free(hash); /* Check CONFIG_PROTECT */ if (config_protected(cpath, cp_argc, cp_argv, cpm_argc, cpm_argv)) { @@ -1102,6 +1103,7 @@ pkg_unmerge(q_vdb_pkg_ctx *pkg_ctx, queue *keep) /* If the file wasn't modified, unmerge it */ unsigned char *hash = hash_file_at(portroot_fd, e->name + 1, HASH_MD5); protected = strcmp(e->digest, (const char *)hash); + free(hash); } break; @@ -1232,6 +1234,7 @@ pkg_verify_checksums(char *fname, const struct pkg_t *pkg, const depend_atom *at warn("MD5: [%sER%s] (%s) != (%s) %s/%s", RED, NORM, hash, pkg->MD5, atom->CATEGORY, pkg->PF); ret++; } + free(hash); } if (pkg->SHA1[0]) { @@ -1244,6 +1247,7 @@ pkg_verify_checksums(char *fname, const struct pkg_t *pkg, const depend_atom *at warn("SHA1: [%sER%s] (%s) != (%s) %s/%s", RED, NORM, hash, pkg->SHA1, atom->CATEGORY, pkg->PF); ret++; } + free(hash); } if (!pkg->SHA1[0] && !pkg->MD5[0])