Permalink
Browse files

tcpint.c: fix memleak

  • Loading branch information...
jsynacek committed May 16, 2012
1 parent 316adda commit e75406018196636b0d96ec67ac0b3951c7b7d374
Showing with 8 additions and 5 deletions.
  1. +8 −5 xinetd/tcpint.c
View
@@ -108,7 +108,7 @@ static void si_mux(void)
n_ready = int_select( mask_max+1, &read_mask ) ;
if ( n_ready == -1 )
- return ;
+ goto free_iter ;
if ( FD_ISSET( INT_REMOTE( ip ), &read_mask ) )
{
@@ -136,9 +136,9 @@ static void si_mux(void)
chp->ch_local_socket ) ;
#endif
if ( handle_io( iter, chp, &socket_mask, tcp_local_to_remote ) == FAILED )
- return ;
+ goto free_iter ;
if ( --n_ready == 0 )
- break ;
+ goto free_iter ;
}
if ( FD_ISSET( chp->ch_remote_socket, &read_mask ) )
@@ -149,12 +149,15 @@ static void si_mux(void)
#endif
if ( handle_io( iter, chp,
&socket_mask, tcp_remote_to_local ) == FAILED )
- return ;
+ goto free_iter ;
if ( --n_ready == 0 )
- break ;
+ goto free_iter ;
}
}
}
+free_iter:
+ psi_destroy( iter ) ;
+ return ;
}

0 comments on commit e754060

Please sign in to comment.