Main Content
Opening previously opened resource
Opening an already opened file
Description
This defect occurs when a file handling function such as fopen
opens a file
that was previously opened and not closed subsequently.
Risk
If you open a resource multiple times, you can encounter:
A race condition when accessing the file.
Undefined or unexpected behavior for that file.
Portability issues when you run your program on different targets.
Fix
Once a resource is open, close the resource before reopening.
Examples
Result Information
Group: Resource management |
Language: C | C++ |
Default: On for handwritten code, off for generated code |
Command-Line Syntax: DOUBLE_RESOURCE_OPEN |
Impact: Medium |
Version History
Introduced in R2016b
See Also
Topics
- Interpret Bug Finder Results in Polyspace Desktop User Interface
- Interpret Bug Finder Results in Polyspace Access Web Interface (Polyspace Access)
- Address Results in Polyspace User Interface Through Bug Fixes or Justifications
- Address Results in Polyspace Access Through Bug Fixes or Justifications (Polyspace Access)