Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (24 sloc) 548 Bytes
//
// Use kstrdup
//
// Target: Linux
// Copyright: 2012 - LIP6/INRIA
// License: Licensed under ISC. See LICENSE or http://www.isc.org/software/license
// Author: Julia Lawall <Julia.Lawall@lip6.fr>
// URL: http://coccinelle.lip6.fr/
// URL: http://coccinellery.org/
@@
expression a,flag,len;
expression arg,e1,e2;
statement S;
@@
len = strlen(arg)
... when != len = e1
when != arg = e2
a =
- \(kmalloc\|kzalloc\)(len+1,flag)
+ kasprintf(flag,"%s",arg)
<... when != a
if (a == NULL || ...) S
...>
- memcpy(a,arg,len+1);