about summary refs log tree commit diff
path: root/third_party/git/contrib/coccinelle/xstrdup_or_null.cocci
blob: 8e05d1ca4b61b9792a6f7cc4e7d322efeab02e01 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
@@
expression E;
expression V;
@@
- if (E)
-    V = xstrdup(E);
+ V = xstrdup_or_null(E);

@@
expression E;
@@
- xstrdup(absolute_path(E))
+ absolute_pathdup(E)