]> git.treefish.org Git - phys/latlib.git/commitdiff
forgot to close dir.
authorAlex Schmidt <alex@treefish.org>
Tue, 13 Aug 2013 07:54:18 +0000 (09:54 +0200)
committerAlex Schmidt <alex@treefish.org>
Tue, 13 Aug 2013 07:54:18 +0000 (09:54 +0200)
writeout.cpp

index 03423c503de8cffd978ca48a5ab44dce2625475a..af67fb5fc913dfa9032aea8df877578e646007b4 100644 (file)
@@ -130,6 +130,7 @@ string writeout::getdatfile(string subname)
 
   if((dp  = opendir(fulldir.c_str())) == NULL) {
     logf << "Error(" << errno << ") opening " << fulldir << endl;
+    closedir(dp);
     return "";
   }
   
@@ -139,9 +140,11 @@ string writeout::getdatfile(string subname)
 
       if(myfile.length() > 3 && myfile.substr(myfile.length()-4) == "part" &&
         subname == myfile.substr( myfile.find("-")+1, myfile.rfind(".")-myfile.find("-")-1 ) ) {
+       closedir(dp);
        return myfile;
       }
     }
 
+  closedir(dp);
   return "";
 }