From 9e6e653c5709e3088c20e3958df5520cc3f7c541 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Mon, 29 Mar 2021 23:20:00 +0200 Subject: [PATCH] plugins: pidfile: fix subtle memory leak Since the introduction of the iwatch framework we can now safely free the memory allocated by realpath() and prevent leaks in a more elegant way than before. Signed-off-by: Joachim Wiberg --- plugins/pidfile.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/pidfile.c b/plugins/pidfile.c index 50026dc8..36ea3aaf 100644 --- a/plugins/pidfile.c +++ b/plugins/pidfile.c @@ -250,6 +250,8 @@ static void pidfile_init(void *arg) if (pidfile_add_path(&iw_pidfile, path)) iwatch_exit(&iw_pidfile); + + free(path); } /*