diff --git a/pidfile.c b/pidfile.c index af8b67b..5659011 100644 --- a/pidfile.c +++ b/pidfile.c @@ -122,8 +122,10 @@ pidfile(const char *basename) static void pidfile_cleanup(void) { - - if (pidfile_path != NULL && pidfile_pid == getpid()) + if (pidfile_path != NULL && pidfile_pid == getpid()) { (void) unlink(pidfile_path); + free(pidfile_path); + pidfile_path = NULL; + } } #endif