[clang] [clang][docs] Fix example in SanitizerSpecialCaseList.rst (PR #149244)

Vitaly Buka via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 16 21:02:58 PDT 2025


https://github.com/vitalybuka created https://github.com/llvm/llvm-project/pull/149244

As-ie example suppresses buffer overflow in
malloc, and leave memory leak in place. It can be
confusing.

Fixes #62421.


>From f885749699d886d77d8290ca250276704e677dd7 Mon Sep 17 00:00:00 2001
From: Vitaly Buka <vitalybuka at google.com>
Date: Wed, 16 Jul 2025 21:02:43 -0700
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=
 =?UTF-8?q?l=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.6
---
 clang/docs/SanitizerSpecialCaseList.rst | 1 +
 1 file changed, 1 insertion(+)

diff --git a/clang/docs/SanitizerSpecialCaseList.rst b/clang/docs/SanitizerSpecialCaseList.rst
index 2c50778d0f491..194f2fc5a7825 100644
--- a/clang/docs/SanitizerSpecialCaseList.rst
+++ b/clang/docs/SanitizerSpecialCaseList.rst
@@ -39,6 +39,7 @@ Example
   void bad_foo() {
     int *a = (int*)malloc(40);
     a[10] = 1;
+    free(a);
   }
   int main() { bad_foo(); }
   $ cat ignorelist.txt



More information about the cfe-commits mailing list