Files
Junio C Hamano 32814b69d0 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 <gitster@pobox.com>
2026-09-11 15:25:28 -07:00

38 lines
313 B
Plaintext

@@
expression E;
@@
- if (E)
(
free(E);
|
commit_list_free(E);
|
FREE_AND_NULL(E);
)
@@
expression E;
@@
- free(E);
+ FREE_AND_NULL(E);
- E = NULL;
@@
expression E;
@@
- if (E)
- {
commit_list_free(E);
E = NULL;
- }
@@
expression E;
statement S;
@@
- if (E) {
+ if (E)
S
commit_list_free(E);
- }