[Nagios-devel] [PATCH] core: Don't free the lock file path too soon

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] [PATCH] core: Don't free the lock file path too soon

Post by Guest »

It's used after the main loop ends in the main function to remove the
lock file once we're shut down.

As the variable was already freed and pointed to NULL, unlink would not
remove the lock file, but instead return EFAULT. This is not how daemons
are supposed to behave.

Signed-off-by: Robin Sonefors
---
base/utils.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/base/utils.c b/base/utils.c
index 5e038cb..362e683 100644
--- a/base/utils.c
+++ b/base/utils.c
@@ -2902,7 +2902,6 @@ void free_memory(nagios_macros *mac) {
my_free(command_file);
mac->x[MACRO_COMMANDFILE] = NULL; /* assigned from command_file */
my_free(log_archive_path);
- my_free(lock_file);

for (i = 0; i < MAX_USER_MACROS; i++) {
my_free(macro_user);
--
1.7.11.7






This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked