summaryrefslogtreecommitdiffstats
path: root/coccinelle/strdupa.cocci
diff options
context:
space:
mode:
Diffstat (limited to 'coccinelle/strdupa.cocci')
-rw-r--r--coccinelle/strdupa.cocci11
1 files changed, 11 insertions, 0 deletions
diff --git a/coccinelle/strdupa.cocci b/coccinelle/strdupa.cocci
new file mode 100644
index 0000000..665736e
--- /dev/null
+++ b/coccinelle/strdupa.cocci
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+@@
+expression x;
+@@
+- strdupa(x)
++ strdupa_safe(x)
+@@
+expression x, n;
+@@
+- strndupa(x, n)
++ strndupa_safe(x, n)