Resource Leak
A Resource Leak is a software defect that occurs when a computer program fails to release resources it has acquired. Common examples include Memory Leak, File Descriptor exhaustion, and unclosed Network Socket connections. When these resources are not returned to the Operating System or the resource pool, the system may eventually run out of the specific resource, leading to slowed performance, application crashes, or a Denial of Service.
In manual memory management environments like the C Programming Language, developers must explicitly call functions to free allocated memory. Failure to do so is a primary cause of leaks. In high-level languages such as Java or Python, while Garbage Collection handles memory, developers must still manage non-memory resources like a Database Connection or file streams manually or through specific language constructs.
Modern programming practices suggest using the RAII (Resource Acquisition Is Initialization) pattern or a Context Manager to ensure resources are properly disposed of even when errors occur. For more technical details on identifying these vulnerabilities, consult the CWE-404: Improper Resource Shutdown or Release or the Wikipedia entry on Resource Leaks.