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

Peiqi Li via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 7 19:14:40 PDT 2026


================
@@ -1771,7 +1771,14 @@ void testMallocIntoMalloc(void) {
   StructWithPtr *s = malloc(sizeof(StructWithPtr));
   s->memP = malloc(sizeof(int));
   free(s);
-} // FIXME: should warn here
----------------
voyager-jhk wrote:

Thanks, I agree — I was oversimplifying the escape semantics. I'm reworking the fix and will update the PR.

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


More information about the cfe-commits mailing list