summaryrefslogtreecommitdiff
path: root/coccinelle/take-ptr.cocci
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2018-06-22 13:38:31 +0200
committerMichael Biebl <biebl@debian.org>2018-06-22 13:38:31 +0200
commitb012e92123bdc9fa10c2f079ec5bd9313b23e21a (patch)
tree94b74f04796e0da187092db7c2487aaf30f0faf1 /coccinelle/take-ptr.cocci
parent98393f852f2f66a74f7370aa63c07b26d610343c (diff)
downloadsystemd-b012e92123bdc9fa10c2f079ec5bd9313b23e21a.tar.gz
New upstream version 239
Diffstat (limited to 'coccinelle/take-ptr.cocci')
-rw-r--r--coccinelle/take-ptr.cocci14
1 files changed, 14 insertions, 0 deletions
diff --git a/coccinelle/take-ptr.cocci b/coccinelle/take-ptr.cocci
new file mode 100644
index 0000000000..0cebe81575
--- /dev/null
+++ b/coccinelle/take-ptr.cocci
@@ -0,0 +1,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);