From 147537d944899fd6035ce107034a05ad4fde4ca9 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Wed, 26 Sep 2012 11:36:54 +0000
Subject: [PATCH] forgot fclose !

---
 Common/CommandLine.cpp | 2 +-
 Geo/GModelIO_MSH.cpp   | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/Common/CommandLine.cpp b/Common/CommandLine.cpp
index 8f05887e34..8be952b69e 100644
--- a/Common/CommandLine.cpp
+++ b/Common/CommandLine.cpp
@@ -154,7 +154,7 @@ void GetOptions(int argc, char *argv[])
           i += 2;
         }
         else if(argv[i]){
-          Msg::InitializeOnelab(argv[i], "");
+          Msg::InitializeOnelab(argv[i]);
           i += 1;
         }
         else
diff --git a/Geo/GModelIO_MSH.cpp b/Geo/GModelIO_MSH.cpp
index 348bbb6235..fe34553874 100644
--- a/Geo/GModelIO_MSH.cpp
+++ b/Geo/GModelIO_MSH.cpp
@@ -46,7 +46,10 @@ int GModel::readMSH(const std::string &name)
       if(!fgets(str, sizeof(str), fp)) return 0;
       int format, size;
       if(sscanf(str, "%lf %d %d", &version, &format, &size) != 3) return 0;
-      if(version < 3.) return _readMSH2(name);
+      if(version < 3.){
+        fclose(fp);
+        return _readMSH2(name);
+      }
       if(format){
         binary = true;
         Msg::Info("Mesh is in binary format");
-- 
GitLab