nbd-server: avoid modernsock descriptor leaking to child processes
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 21 Jun 2012 21:39:17 +0000 (01:39 +0400)
committerWouter Verhelst <w@uter.be>
Sat, 23 Jun 2012 23:38:34 +0000 (01:38 +0200)
Close modernsock descriptor in child processes.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
nbd-server.c

index 53e7b1839c5fbafd50ac43e58f5f43b26b94a0d3..c789051eb7984cdebe683729c4d3d2c5a17f21e1 100644 (file)
@@ -2278,6 +2278,7 @@ int serveloop(GArray* servers) {
                                           data, and otherwise we get a
                                           segfault... */
                                        g_array_free(servers, FALSE);
+                                       close(modernsock);
                                }
 
                                msg2(LOG_INFO,"Starting to serve");