Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[daemon/check_uniqueness.c:46]: (error) Resource leak: fp #9

Open
dcb314 opened this issue Feb 2, 2016 · 1 comment
Open

[daemon/check_uniqueness.c:46]: (error) Resource leak: fp #9

dcb314 opened this issue Feb 2, 2016 · 1 comment

Comments

@dcb314
Copy link

dcb314 commented Feb 2, 2016

Source code is

if((fp = fopen(GPM_NODE_PID, "r")) != NULL) {
fscanf(fp, "%d", &old_pid);
if (kill(old_pid,0) == -1) {
gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID);
unlink(GPM_NODE_PID);
} else /* we are really running, exit asap! /
gpm_report(GPM_PR_OOPS,GPM_MESS_ALREADY_RUN, old_pid);
}
/
now try to sign ourself */
if ((fp = fopen(GPM_NODE_PID,"w")) != NULL) {

So if the first fopen succeeds, then there seems to be a missing call to fclose.

@telmich
Copy link
Owner

telmich commented Feb 14, 2016

You might be right - can you send a pull request for a patch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants