summaryrefslogtreecommitdiff
path: root/contrib/coccinelle/xstrdup_or_null.cocci
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/coccinelle/xstrdup_or_null.cocci')
-rw-r--r--contrib/coccinelle/xstrdup_or_null.cocci6
1 files changed, 6 insertions, 0 deletions
diff --git a/contrib/coccinelle/xstrdup_or_null.cocci b/contrib/coccinelle/xstrdup_or_null.cocci
index 3fceef132b..8e05d1ca4b 100644
--- a/contrib/coccinelle/xstrdup_or_null.cocci
+++ b/contrib/coccinelle/xstrdup_or_null.cocci
@@ -5,3 +5,9 @@ expression V;
- if (E)
- V = xstrdup(E);
+ V = xstrdup_or_null(E);
+
+@@
+expression E;
+@@
+- xstrdup(absolute_path(E))
++ absolute_pathdup(E)