lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190316080556.3075-6-changbin.du@gmail.com>
Date:   Sat, 16 Mar 2019 16:05:45 +0800
From:   Changbin Du <changbin.du@...il.com>
To:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Jiri Olsa <jolsa@...nel.org>
Cc:     namhyung@...nel.org, Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Alexei Starovoitov <ast@...nel.org>, rostedt@...dmis.org,
        Daniel Borkmann <daniel@...earbox.net>, bpf@...r.kernel.org,
        linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
        Changbin Du <changbin.du@...il.com>
Subject: [PATCH 05/16] perf: fix a memory leak in collect_config

Direct leak of 66 byte(s) in 5 object(s) allocated from:
    #0 0x7ff3b1f32070 in __interceptor_strdup (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x3b070)
    #1 0x560c8761034d in collect_config util/config.c:597
    #2 0x560c8760d9cb in get_value util/config.c:169
    #3 0x560c8760dfd7 in perf_parse_file util/config.c:285
    #4 0x560c8760e0d2 in perf_config_from_file util/config.c:476
    #5 0x560c876108fd in perf_config_set__init util/config.c:661
    #6 0x560c87610c72 in perf_config_set__new util/config.c:709
    #7 0x560c87610d2f in perf_config__init util/config.c:718
    #8 0x560c87610e5d in perf_config util/config.c:730
    #9 0x560c875ddea0 in main /home/changbin/work/linux/tools/perf/perf.c:442
    #10 0x7ff3afb8609a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)

Signed-off-by: Changbin Du <changbin.du@...il.com>
---
 tools/perf/util/config.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c
index fa092511c52b..7e3c1b60120c 100644
--- a/tools/perf/util/config.c
+++ b/tools/perf/util/config.c
@@ -633,11 +633,10 @@ static int collect_config(const char *var, const char *value,
 	}
 
 	ret = set_value(item, value);
-	return ret;
 
 out_free:
 	free(key);
-	return -1;
+	return ret;
 }
 
 int perf_config_set__collect(struct perf_config_set *set, const char *file_name,
-- 
2.19.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ