Skip to content

Commit 6dcfb1e

Browse files
committed
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
2 parents a6977c8 + 32814b6 commit 6dcfb1e

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

‎tools/coccinelle/free.cocci‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,8 @@ expression E;
66
free(E);
77
|
88
commit_list_free(E);
9-
)
10-
11-
@@
12-
expression E;
13-
@@
14-
- if (!E)
15-
(
16-
free(E);
179
|
18-
commit_list_free(E);
10+
FREE_AND_NULL(E);
1911
)
2012

2113
@@

0 commit comments

Comments
 (0)