From: Julia Lawall Date: Tue, 24 Aug 2010 04:39:49 +0000 (+0000) Subject: net/netfilter/ipvs: Eliminate memory leak X-Git-Tag: v2.6.37-rc1~147^2~666 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2aff96327545aa5ceb25e3116be69c8b06de703;p=pandora-kernel.git net/netfilter/ipvs: Eliminate memory leak __ip_vs_service_get and __ip_vs_svc_fwm_get increment a reference count, so that reference count should be decremented before leaving the function in an error case. A simplified version of the semantic match that finds this problem is: (http://coccinelle.lip6.fr/) // @r exists@ local idexpression x; expression E; identifier f1; iterator I; @@ x = __ip_vs_service_get(...); <... when != x when != true (x == NULL || ...) when != if (...) { <+...x...+> } when != I (...) { <+...x...+> } ( x == NULL | x == E | x->f1 ) ...> * return ...; // Signed-off-by: Julia Lawall Signed-off-by: Simon Horman Signed-off-by: David S. Miller --- Reading git-diff-tree failed