You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.
Created by snakebyte on 2010-04-29 14:59:23 +00:00
Assignee: mfriedrich
Status: Resolved (closed on 2010-05-05 14:15:07 +00:00)
Target Version: 1.0.2
Last Update: 2010-05-05 14:15:07 +00:00 (in Redmine)
hi,
there are two unused variables (found and statbuf) as well
as a memory leak (daemon_name is only used once, never freed)
and a descriptor leak (fp never gets closed)
This issue has been migrated from Redmine: https://dev.icinga.com/issues/386
Created by snakebyte on 2010-04-29 14:59:23 +00:00
Assignee: mfriedrich
Status: Resolved (closed on 2010-05-05 14:15:07 +00:00)
Target Version: 1.0.2
Last Update: 2010-05-05 14:15:07 +00:00 (in Redmine)
hi,
there are two unused variables (found and statbuf) as well
as a memory leak (daemon_name is only used once, never freed)
and a descriptor leak (fp never gets closed)
Regards, Eric
--- icinga-core/cgi/cgiutils.c.orig 2010-04-29 16:53:46.000000000 +0200
**+ icinga-core/cgi/cgiutils.c 2010-04-29 16:56:39.000000000 +0200
@ -2291,9 +2291,7
@ int check_daemon_running(void) {char *proc_file=NULL;
char *input = NULL;
char *val = NULL;
char input_buffer[CHARLEN];
mmapfile *fk;
FILE *fp;
@ -2306,9 +2304,7
@ int check_daemon_running(void) {if((fk=mmap_fopen(lock_file))==NULL) {
/* no lock file found try program name instead */
free(proc_file);
return ERROR;
}
@ -2321,13 +2317,14
@ int check_daemon_running(void) {fgets(input_buffer,CHARLEN-1,fp);
fgets(input_buffer,CHARLEN-1,fp);
/* check if entry found */
if (sscanf(input_buffer,"%d",&testpid)!=1) {
return ERROR;
} else {
/* daemon is running */
return OK;
}
}
Attachments
Changesets
2010-05-05 14:10:25 +00:00 by mfriedrich b8de14a
2010-05-05 14:12:20 +00:00 by mfriedrich ee0ab2d
Relations:
The text was updated successfully, but these errors were encountered: