File: 25_fix-fd-leak.diff

package info (click to toggle)
openvpn-auth-radius 2.1-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,824 kB
  • sloc: cpp: 9,043; perl: 323; makefile: 46
file content (18 lines) | stat: -rw-r--r-- 561 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
There is a file descriptor leak in an errors path in AccountingProcess.cpp.
--- a/AccountingProcess.cpp
+++ b/AccountingProcess.cpp
@@ -478,12 +478,14 @@
 	string exe=string(context->conf.getVsaScript()) + " " + string(context->conf.getVsaNamedPipe());
 	if (write (fd_fifo, buf, buflen) != buflen)
 	{
+	  close(fd_fifo);
 	  cerr << getTime() << "RADIUS-PLUGIN: Could not write in Pipe to VSAScript!";
       return -1;
 	}
 	
 	if(system(exe.c_str())!=0)
 	{
+		close(fd_fifo);
 		cerr << getTime() << "RADIUS-PLUGIN: Error in VSAScript!";
 		return -1;
 	}