xinetd/tcpint.c-fix-memleak.patch

53 lines
1.3 KiB
Diff
Raw Permalink Normal View History

2019-09-30 11:20:12 -04:00
From e75406018196636b0d96ec67ac0b3951c7b7d374 Mon Sep 17 00:00:00 2001
From: Jan Synacek <jsynacek@redhat.com>
Date: Wed, 16 May 2012 09:11:56 +0200
Subject: [PATCH 05/16] tcpint.c: fix memleak
---
xinetd/tcpint.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/xinetd/tcpint.c b/xinetd/tcpint.c
index cd6474f..34a2ca9 100644
--- a/xinetd/tcpint.c
+++ b/xinetd/tcpint.c
@@ -134,7 +134,7 @@ static void si_mux(void)
#endif
if ( n_ready == -1 )
- return ;
+ goto free_iter ;
#ifdef HAVE_POLL
if ( pfd_array[0].revents & ( POLLIN | POLLOUT ) )
@@ -193,9 +193,9 @@ static void si_mux(void)
#else
if ( handle_io( iter, chp, &socket_mask, tcp_local_to_remote ) == FAILED )
#endif
- return ;
+ goto free_iter ;
if ( --n_ready == 0 )
- break ;
+ goto free_iter ;
}
#ifdef HAVE_POLL
@@ -216,12 +216,15 @@ static void si_mux(void)
if ( handle_io( iter, chp,
&socket_mask, tcp_remote_to_local ) == FAILED )
#endif
- return ;
+ goto free_iter ;
if ( --n_ready == 0 )
- break ;
+ goto free_iter ;
}
}
}
+free_iter:
+ psi_destroy( iter ) ;
+ return ;
}