From 961c626d6d494cc520777498536239cd93623568 Mon Sep 17 00:00:00 2001 From: Mansour Moufid Date: Tue, 17 Feb 2015 13:07:29 -0500 Subject: [PATCH] Add a semantic patch to find potential memory leaks. --- scripts/find-mem-leak.cocci | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 scripts/find-mem-leak.cocci diff --git a/scripts/find-mem-leak.cocci b/scripts/find-mem-leak.cocci new file mode 100644 index 0000000000..a3f7ca99c8 --- /dev/null +++ b/scripts/find-mem-leak.cocci @@ -0,0 +1,9 @@ +@@ +expression x, y; +statement S; +@@ + x = polarssl_malloc(...); + y = polarssl_malloc(...); + ... +* if (x == NULL || y == NULL) + S