From: Alex Schmidt Date: Tue, 13 Aug 2013 07:54:18 +0000 (+0200) Subject: forgot to close dir. X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/commitdiff_plain/71a0a66deb80dc52590280b3aa470b970862db93 forgot to close dir. --- 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 ""; }