Skip to content

Commit

Permalink
lib: pidfile: Prevent double-free
Browse files Browse the repository at this point in the history
In the unlikely case someone tries to call pidfile() again, after
pidfile_cleanup().

Signed-off-by: Joachim Nilsson <[email protected]>
  • Loading branch information
troglobit committed Jun 20, 2020
1 parent 50b24f7 commit 61767ba
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/pidfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,6 @@ pidfile_cleanup(void)
if (pidfile_path != NULL && pidfile_pid == getpid()) {
(void)unlink(pidfile_path);
free(pidfile_path);
pidfile_path = NULL;
}
}

0 comments on commit 61767ba

Please sign in to comment.