diff --git a/src/box/xlog.cc b/src/box/xlog.cc
index 2b804114267371b48184f0eb7aaf7379d4dfced4..d9062acbded5f055d6a76e3d23d433ba2c02eee6 100644
--- a/src/box/xlog.cc
+++ b/src/box/xlog.cc
@@ -646,8 +646,6 @@ xlog_atfork(struct xlog **lptr)
 		 * fclose().
 		 */
 		close(fileno(l->f));
-		fclose(l->f);
-		free(l);
 		*lptr = NULL;
 	}
 }
diff --git a/test/app/snapshot.test.lua b/test/app/snapshot.test.lua
index c98cbf9a16b381852d202c34039bb2e8359bb3c0..a2d78590a083244187636bb4f0e8ad7c00fe6580 100755
--- a/test/app/snapshot.test.lua
+++ b/test/app/snapshot.test.lua
@@ -5,9 +5,11 @@ fiber = require('fiber')
 --
 -- Check that Tarantool creates ADMIN session for #! script
 --
+continue_snapshoting = true
+
 function noise()
     fiber.name('noise-'..fiber.id())
-    while true do
+    while continue_snapshoting do
         if box.space.test:len() < 300000 then
             local  value = string.rep('a', math.random(255)+1)
             box.space.test:auto_increment{fiber.time64(), value}
@@ -18,7 +20,7 @@ end
 
 function purge()
     fiber.name('purge-'..fiber.id())
-    while true do
+    while continue_snapshoting do
         local min = box.space.test.index.primary:min()
         if min ~= nil then
             box.space.test:delete{min[1]}
@@ -27,18 +29,13 @@ function purge()
     end
 end
 
-continue_snapshoting = true
-
 function snapshot(lsn)
     fiber.name('snapshot')
-    while true do
+    while continue_snapshoting do
         local new_lsn = box.info.server.lsn
         if new_lsn ~= lsn then
             lsn = new_lsn;
-            box.snapshot()
-        end
-        if not continue_snapshoting then
-            break
+            pcall(box.snapshot)
         end
         fiber.sleep(0.001)
     end