Browse Source

Fixed some memory leaks

lintest
Michael Uleysky 10 months ago
parent
commit
e191f99c8f
  1. 1
      include/cache.h
  2. 5
      sources/COPERNICUS.cpp

1
include/cache.h

@ -115,6 +115,7 @@ class SQLiteCache: public GenericCache
if(i == SQLITE_OK) i = sqlite3_bind_int64(sqst, 1, time(nullptr));
if(i == SQLITE_OK) i = sqlite3_step(sqst);
sqlite3_finalize(sqst);
sqlite3_close_v2(db);
}
explicit operator bool() const { return db != nullptr; }

5
sources/COPERNICUS.cpp

@ -201,6 +201,7 @@ MString COPERNICUSData::Mirror(const CLArgs& args)
}
}
CURLRAII dhandle;
for(const auto& dset: dsets)
{
michlib::message("Mirroring " + dset);
@ -258,7 +259,7 @@ MString COPERNICUSData::Mirror(const CLArgs& args)
for(size_t i = 0; i < down.size(); i++)
{
size_t ri = down[i];
auto err = DownloadFile(chandle, rfiles[ri], locroot);
auto err = DownloadFile(dhandle, rfiles[ri], locroot);
if(err.Exist()) return err;
}
@ -273,7 +274,7 @@ MString COPERNICUSData::Mirror(const CLArgs& args)
{
size_t ri = upd[i].first;
size_t li = upd[i].second;
auto err = UpdateFile(chandle, rfiles[ri], lfiles[li], locroot);
auto err = UpdateFile(dhandle, rfiles[ri], lfiles[li], locroot);
if(err.Exist()) return err;
}
}

Loading…
Cancel
Save