X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/blobdiff_plain/40171a80594f79b137900fae122a2e33a3a88f95..dddf9581bc6442e82a1a9fb626f6c04c9ca7d07a:/writeout.cpp?ds=sidebyside diff --git a/writeout.cpp b/writeout.cpp index 03423c5..af67fb5 100644 --- a/writeout.cpp +++ b/writeout.cpp @@ -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 ""; }