X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/blobdiff_plain/40171a80594f79b137900fae122a2e33a3a88f95..1a6e4ad36f2b712a042007efb5184e2f34958595:/writeout.cpp 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 ""; }