Browse Source

- fixed memleak

master
parent
commit
850cd580a7
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      src/lib/checksum.cpp

+ 3
- 0
src/lib/checksum.cpp View File

@ -9,6 +9,7 @@
string Checksum::checksum_of_file(string filepath, checksum_algorithms alg) {
ifstream file (filepath, ios::ate);
stringstream hex_result;
// cout << "processing file '" << filepath << "'" << endl;
if (file.is_open() ) {
ifstream::pos_type fileSize;
char * memBlock;
@ -34,6 +35,7 @@ string Checksum::checksum_of_file(string filepath, checksum_algorithms alg) {
break;
}
}
delete memBlock;
// cout << "# # CHECKSUM for filepath '" << filepath << "' " << hex_result.str() << endl;
file.close();
} else {
@ -45,6 +47,7 @@ string Checksum::checksum_of_file(string filepath, checksum_algorithms alg) {
oxum_t Checksum::oxum_of_file(string filepath) {
ifstream file (filepath, ios::ate);
oxum_t oxum;
//cout << "processing file '" << filepath << "'" << endl;
if (file.is_open() ) {
ifstream::pos_type fileSize;
fileSize = file.tellg();


Loading…
Cancel
Save