summaryrefslogtreecommitdiff
path: root/coccinelle/take-ptr.cocci
blob: 0cebe815759fe2f68f46b3f7678068d682f11627 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
@@
local idexpression p;
expression q;
@@
- p = q;
- q = NULL;
- return p;
+ return TAKE_PTR(q);
@@
expression p, q;
@@
- p = q;
- q = NULL;
+ p = TAKE_PTR(q);