mirror of
https://github.com/osmarks/ngircd.git
synced 2025-10-21 17:37:38 +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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user