Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage-utils:master commit in: /
Date: Fri, 31 Jan 2020 13:26:52
Message-Id: 1580476018.fafb4fcd0de20133cf61b5c92fdf1649568b3949.grobian@gentoo
1 commit: fafb4fcd0de20133cf61b5c92fdf1649568b3949
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 31 13:06:58 2020 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Fri Jan 31 13:06:58 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=fafb4fcd
7
8 qsize: fix Coverity 207953 Resource leak
9
10 no leak can really be leaked here, because input set is never NULL, but
11 it won't hurt (or cause problems in the future), so let's do it
12
13 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
14
15 qsize.c | 3 ++-
16 1 file changed, 2 insertions(+), 1 deletion(-)
17
18 diff --git a/qsize.c b/qsize.c
19 index 1a1b40e..e54f714 100644
20 --- a/qsize.c
21 +++ b/qsize.c
22 @@ -145,7 +145,8 @@ qsize_cb(tree_pkg_ctx *pkg_ctx, void *priv)
23 {
24 snprintf(ikey, sizeof(ikey), "%zx%zx",
25 (size_t)st.st_dev, (size_t)st.st_ino);
26 - add_set_unique(ikey, state->uniq_files, &isuniq);
27 + state->uniq_files =
28 + add_set_unique(ikey, state->uniq_files, &isuniq);
29 if (isuniq)
30 num_bytes +=
31 state->fs_size ? st.st_blocks * S_BLKSIZE : st.st_size;