From 32814b69d05714c42def93b44a6ff8f1a242e8fe Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 11 Sep 2026 15:21:35 -0700 Subject: [PATCH] cocci: FREE_AND_NULL(E) is safe to call on NULL Just like we allow calling free(E) without checking if E is not NULL, it is safe to call FREE_AND_NULL(E) unconditionally. Signed-off-by: Junio C Hamano --- tools/coccinelle/free.cocci | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/coccinelle/free.cocci b/tools/coccinelle/free.cocci index 3dfaae9dd8..f2af140cfb 100644 --- a/tools/coccinelle/free.cocci +++ b/tools/coccinelle/free.cocci @@ -6,6 +6,8 @@ expression E; free(E); | commit_list_free(E); +| + FREE_AND_NULL(E); ) @@