aboutsummaryrefslogtreecommitdiff
path: root/lib/Checker/StreamChecker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Checker/StreamChecker.cpp')
-rw-r--r--lib/Checker/StreamChecker.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Checker/StreamChecker.cpp b/lib/Checker/StreamChecker.cpp
index 37129be245..b18ab2908c 100644
--- a/lib/Checker/StreamChecker.cpp
+++ b/lib/Checker/StreamChecker.cpp
@@ -373,7 +373,10 @@ const GRState *StreamChecker::CheckDoubleClose(const CallExpr *CE,
assert(Sym);
const StreamState *SS = state->get<StreamState>(Sym);
- assert(SS);
+
+ // If the file stream is not tracked, return.
+ if (!SS)
+ return state;
// Check: Double close a File Descriptor could cause undefined behaviour.
// Conforming to man-pages