[clang] [clang] Fix NewDeleteLeaks false negative for heap fields (PR #221587)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 7 05:07:52 PDT 2026


https://github.com/NagyDonat requested changes to this pull request.

This is a knee-jerk change that (presumably) eliminates a false negative, but will probably introduce false positives in other situations.

The analyzer is inherently conservative and only reports code where it can _prove_ that there are problems. When a pointer "escapes" (that is, becomes accessible for code that is not executed symbolically), the analyzer cannot prove that it wasn't `free()`ed later, so it needs to suppress the memory leak report for it.

https://github.com/llvm/llvm-project/pull/221587


More information about the cfe-commits mailing list