updated for version 7.2-300
diff --git a/src/memfile.c b/src/memfile.c
index 0b3cdd9..bd03e65 100644
--- a/src/memfile.c
+++ b/src/memfile.c
@@ -1343,6 +1343,11 @@
     }
     else
     {
+#ifdef HAVE_FD_CLOEXEC
+	int fdflags = fcntl(mfp->mf_fd, F_GETFD);
+	if (fdflags >= 0 && (fdflags & FD_CLOEXEC) == 0)
+	    fcntl(mfp->mf_fd, F_SETFD, fdflags | FD_CLOEXEC);
+#endif
 #ifdef HAVE_SELINUX
 	mch_copy_sec(fname, mfp->mf_fname);
 #endif