mirror of
https://github.com/osmarks/ngircd.git
synced 2024-12-12 18:00:28 +00:00
Pidfile_Create(): Don't leak file descriptor on error path
Detected by cppcheck: [src/ngircd/ngircd.c:502]: (error) Resource leak: pidfd
This commit is contained in:
parent
c9b152fa41
commit
7faa3ed7d6
@ -498,7 +498,8 @@ Pidfile_Create(pid_t pid)
|
||||
|
||||
len = snprintf(pidbuf, sizeof pidbuf, "%ld\n", (long)pid);
|
||||
if (len < 0 || len >= (int)sizeof pidbuf) {
|
||||
Log( LOG_ERR, "Error converting pid");
|
||||
Log(LOG_ERR, "Error converting pid");
|
||||
close(pidfd);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user