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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211110022012.16620-1-sohaib.amhmd@gmail.com>
Date:   Wed, 10 Nov 2021 04:20:11 +0200
From:   Sohaib Mohamed <sohaib.amhmd@...il.com>
To:     unlisted-recipients:; (no To-header on input)
Cc:     sohaib.amhmd@...il.com, irogers@...gle.com,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Pierre Gondois <Pierre.Gondois@....com>,
        Rusty Russell <rusty@...tcorp.com.au>,
        Hitoshi Mitake <mitake@....info.waseda.ac.jp>,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH v2] perf bench: Fix memory leaks.

ASan reports memory leaks while running:
$ perf bench sched all

Fixes: e27454cc6352 ("perf bench: Add sched-messaging.c: Benchmark for
scheduler and IPC mechanisms based on hackbench")

Signed-off-by: Sohaib Mohamed <sohaib.amhmd@...il.com>
Acked-by: Ian Rogers <irogers@...gle.com>
---
 tools/perf/bench/sched-messaging.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/perf/bench/sched-messaging.c b/tools/perf/bench/sched-messaging.c
index 488f6e6ba1a5..fa0ff4ce2b74 100644
--- a/tools/perf/bench/sched-messaging.c
+++ b/tools/perf/bench/sched-messaging.c
@@ -223,6 +223,8 @@ static unsigned int group(pthread_t *pth,
 		snd_ctx->out_fds[i] = fds[1];
 		if (!thread_mode)
 			close(fds[0]);
+
+		free(ctx);
 	}

 	/* Now we have all the fds, fork the senders */
@@ -239,6 +241,8 @@ static unsigned int group(pthread_t *pth,
 		for (i = 0; i < num_fds; i++)
 			close(snd_ctx->out_fds[i]);

+	free(snd_ctx);
+
 	/* Return number of children to reap */
 	return num_fds * 2;
 }
--
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ