summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2010-08-27 19:31:56 -0700
committerDavid S. Miller <davem@davemloft.net>2010-08-27 19:31:56 -0700
commitc34186ed008229e7f7e3f1de8e6acf6374995358 (patch)
treeb8d24a6503fc847d7dd1fa55b73aa9ca45781730 /drivers/net
parent7e368739e3b3f1d7944794c178a15f05829b56bc (diff)
downloadop-kernel-dev-c34186ed008229e7f7e3f1de8e6acf6374995358.zip
op-kernel-dev-c34186ed008229e7f7e3f1de8e6acf6374995358.tar.gz
net/ipv4: Eliminate kstrdup memory leak
The string clone is only used as a temporary copy of the argument val within the while loop, and so it should be freed before leaving the function. The call to strsep, however, modifies clone, so a pointer to the front of the string is kept in saved_clone, to make it possible to free it. The sematic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r exists@ local idexpression x; expression E; identifier l; statement S; @@ *x= \(kasprintf\|kstrdup\)(...); ... if (x == NULL) S ... when != kfree(x) when != E = x if (...) { <... when != kfree(x) * goto l; ...> * return ...; } // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud