Both applied, thanks
On Fri, May 18, 2018 at 05:10:16PM -0300, Thadeu Lima de Souza Cascardo wrote:
> When fork fails, we return without closing the socket pair that was just
> created. This might cause file descriptor leaks.
>
> Signed-off-by: Thadeu Lima de Souza Cascardo <[email protected]>
> ---
> nbd-server.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/nbd-server.c b/nbd-server.c
> index f5b244f..c2e20c2 100644
> --- a/nbd-server.c
> +++ b/nbd-server.c
> @@ -2807,6 +2807,8 @@ spawn_child(int* socket)
> pid = fork();
> if (pid < 0) {
> msg(LOG_ERR, "Could not fork (%s)", strerror(errno));
> + close(sockets[0]);
> + close(sockets[1]);
> goto out;
> }
> if (pid > 0) { /* Parent */
> --
> 2.17.0
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Nbd-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/nbd-general
>
--
Could you people please use IRC like normal people?!?
-- Amaya Rodrigo Sastre, trying to quiet down the buzz in the DebConf 2008
Hacklab
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nbd-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nbd-general