aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/Support
diff options
context:
space:
mode:
authorAndrea Mattavelli <andreamattavelli@users.noreply.github.com>2017-09-14 13:58:11 +0100
committerGitHub <noreply@github.com>2017-09-14 13:58:11 +0100
commit2108b0e8566bb1d6e8629b7b6806c07010a8269f (patch)
treeb6dce38dd98d681e97d08d0b42adff078ccf7215 /lib/Support
parentd19500eb93083c8cc6bb72bcb54414015830cacb (diff)
parentb5929722363993bf0ad2a56d66176606cc742bc4 (diff)
downloadklee-2108b0e8566bb1d6e8629b7b6806c07010a8269f.tar.gz
Merge pull request #749 from odeits/issue/717
Remove unnecessary null pointer checks
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/FileHandling.cpp3
-rw-r--r--lib/Support/TreeStream.cpp3
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/Support/FileHandling.cpp b/lib/Support/FileHandling.cpp
index e5ead9f7..3e156f3c 100644
--- a/lib/Support/FileHandling.cpp
+++ b/lib/Support/FileHandling.cpp
@@ -31,8 +31,7 @@ llvm::raw_fd_ostream *klee_open_output_file(std::string &path,
f = new llvm::raw_fd_ostream(path.c_str(), error, llvm::sys::fs::F_Binary);
#endif
if (!error.empty()) {
- if (f)
- delete f;
+ delete f;
f = NULL;
}
return f;
diff --git a/lib/Support/TreeStream.cpp b/lib/Support/TreeStream.cpp
index a0e1596f..8681245b 100644
--- a/lib/Support/TreeStream.cpp
+++ b/lib/Support/TreeStream.cpp
@@ -40,8 +40,7 @@ TreeStreamWriter::TreeStreamWriter(const std::string &_path)
TreeStreamWriter::~TreeStreamWriter() {
flush();
- if (output)
- delete output;
+ delete output;
}
bool TreeStreamWriter::good() {