Merge branch 'jc/cocci-free-updates' into jch

Updates to Coccinelle semantic patches to correctly handle the
'FREE_AND_NULL()' macro and avoid generating broken transformations
for negated pointer checks.

* jc/cocci-free-updates:
  cocci: FREE_AND_NULL(E) is safe to call on NULL
  cocci: remove risky "if (!E) free(E)" conversion
jch
Junio C Hamano 2026-09-21 10:03:59 -07:00
commit 548b342aa0
1 changed files with 1 additions and 9 deletions

View File

@ -6,16 +6,8 @@ expression E;
free(E);
|
commit_list_free(E);
)

@@
expression E;
@@
- if (!E)
(
free(E);
|
commit_list_free(E);
FREE_AND_NULL(E);
)

@@