/** * Pass: cleanup-verify (#54, CWE-772) * * Detects resources that have a close() call but that close() does not * post-dominate the acquisition point — meaning some control-flow paths * skip the cleanup entirely. * * Detection strategy: * 1. Find resource-opening calls (same set as ResourceLeakPass). * 2. Locate the corresponding close() call within the enclosing method. * 3. Build a post-dominator graph by reversing all CFG edges and computing * a DominatorGraph from the exit block. * 4. If close() block does NOT post-dominate the open block → emit finding. * * Languages: Java, Python, JavaScript/TypeScript. * Skips: Rust (RAII guarantees cleanup), Bash. * * Note: complements ResourceLeakPass, which handles the no-close() case. */ import type { AnalysisPass, PassContext } from '../../graph/analysis-pass.js'; export interface CleanupVerifyResult { findings: number; } export declare class CleanupVerifyPass implements AnalysisPass { readonly name = "cleanup-verify"; readonly category: "reliability"; run(ctx: PassContext): CleanupVerifyResult; } //# sourceMappingURL=cleanup-verify-pass.d.ts.map