From 61767bad5092ccb03798a7dff519c470fcbe72be Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sat, 20 Jun 2020 10:20:57 +0200 Subject: [PATCH] lib: pidfile: Prevent double-free In the unlikely case someone tries to call pidfile() again, after pidfile_cleanup(). Signed-off-by: Joachim Nilsson --- lib/pidfile.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pidfile.c b/lib/pidfile.c index ba71b34..c32ba98 100644 --- a/lib/pidfile.c +++ b/lib/pidfile.c @@ -107,5 +107,6 @@ pidfile_cleanup(void) if (pidfile_path != NULL && pidfile_pid == getpid()) { (void)unlink(pidfile_path); free(pidfile_path); + pidfile_path = NULL; } }