Blame SOURCES/xinetd-2.3.14-leaking-fds-2a.patch

01101d
diff -Naur xinetd-2.3.14-dist/xinetd/service.c xinetd-2.3.14/xinetd/service.c
01101d
--- xinetd-2.3.14-dist/xinetd/service.c	2012-04-03 08:59:19.000000000 +0200
01101d
+++ xinetd-2.3.14/xinetd/service.c	2012-04-03 09:02:34.588160317 +0200
01101d
@@ -366,12 +366,24 @@
01101d
 
01101d
       msg( LOG_ERR, func,
01101d
                   "socket creation failed (%m). service = %s", SC_ID( scp ) ) ;
01101d
+#ifdef HAVE_POLL
01101d
+      SVC_EVENTS( sp ) = 0;
01101d
+      SVC_FD( sp ) = 0;
01101d
+#else
01101d
+      FD_CLR( SVC_FD( sp ), &ps.rws.socket_mask ) ;
01101d
+#endif /* HAVE_POLL */
01101d
       return( FAILED ) ;
01101d
    }
01101d
 
01101d
    if ( set_fd_modes( sp ) == FAILED )
01101d
    {
01101d
       (void) Sclose( SVC_FD(sp) ) ;
01101d
+#ifdef HAVE_POLL
01101d
+      SVC_EVENTS( sp ) = 0;
01101d
+      SVC_FD( sp ) = 0;
01101d
+#else
01101d
+      FD_CLR( SVC_FD( sp ), &ps.rws.socket_mask ) ;
01101d
+#endif /* HAVE_POLL */
01101d
       return( FAILED ) ;
01101d
    }
01101d
 
01101d
@@ -385,6 +397,12 @@
01101d
    if ( status == FAILED )
01101d
    {
01101d
       (void) Sclose( SVC_FD(sp) ) ;
01101d
+#ifdef HAVE_POLL
01101d
+      SVC_EVENTS( sp ) = 0;
01101d
+      SVC_FD( sp ) = 0;
01101d
+#else
01101d
+      FD_CLR( SVC_FD( sp ), &ps.rws.socket_mask ) ;
01101d
+#endif /* HAVE_POLL */
01101d
       return( FAILED ) ;
01101d
    }
01101d