Skip to content

Commit e08b9a8

Browse files
committed
Fixed alerts by DeepCode
1 parent ef597aa commit e08b9a8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/wsjcpp_hashes.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,11 @@ std::string WsjcppHashes::getMd5ByFile(const std::string &sFilename) {
4545
f.read(pBuffer, nBufferSize);
4646
if (!f) {
4747
delete[] pBuffer;
48-
f.close();
48+
// f.close();
4949
return "Could not read file. Only " + std::to_string(f.gcount()) + " could be read";
5050
}
5151
f.close();
5252

53-
5453
MD5 md5;
5554
md5.update(pBuffer, nBufferSize);
5655
md5.finalize();
@@ -84,7 +83,7 @@ std::string WsjcppHashes::getSha1ByFile(const std::string &sFilename) {
8483
f.read(pBuffer, nBufferSize);
8584
if (!f) {
8685
delete[] pBuffer;
87-
f.close();
86+
// f.close();
8887
return "Could not read file. Only " + std::to_string(f.gcount()) + " could be read";
8988
}
9089
f.close();

0 commit comments

Comments
 (0)