1
0
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:
Alexander Barton 2012-05-22 13:29:31 +02:00
parent c9b152fa41
commit 7faa3ed7d6

View File

@ -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;
}