From 39ea59a2570547166834ceeff9ae0c0c05748f35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sat, 8 Oct 2016 16:14:57 +0200 Subject: remove unnecessary NULL check before free(3) free(3) handles NULL pointers just fine. Add a semantic patch for removing unnecessary NULL checks before calling this function, and apply it on the code base. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- contrib/coccinelle/free.cocci | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 contrib/coccinelle/free.cocci (limited to 'contrib') diff --git a/contrib/coccinelle/free.cocci b/contrib/coccinelle/free.cocci new file mode 100644 index 0000000000..e28213161a --- /dev/null +++ b/contrib/coccinelle/free.cocci @@ -0,0 +1,5 @@ +@@ +expression E; +@@ +- if (E) + free(E); -- cgit v1.2.3