--- a/cspice/src/cspice/open.c	2019-11-02 10:57:10.073886963 +0300
+++ b/cspice/src/cspice/open.c	2019-11-02 10:57:49.230398941 +0300
@@ -324,7 +324,7 @@
 #ifdef NON_ANSI_STDIO
 
       (void) strcpy(buf,"tmp.FXXXXXX");
-      (void) mktemp(buf);
+      fclose(mktemp(buf));
       goto replace;
 
 #else
