Re: [Nagios-devel] [PATCH] core: Don't free the lock file path too soon
Nagios network monitoring software is enterprise server monitoring
Brought to you by:
egalstad,
sawolf-nagios
From: Andreas E. <ae...@op...> - 2013-05-22 09:04:47
|
Will apply. Thanks. On 2013-05-22 10:41, Robin Sonefors wrote: > 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 <rob...@op...> > --- > 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[i]); > -- Andreas Ericsson and...@op... OP5 AB www.op5.se Tel: +46 8-230225 Fax: +46 8-230231 Considering the successes of the wars on alcohol, poverty, drugs and terror, I think we should give some serious thought to declaring war on peace. |