From 263438b071996ae426a5ed3a591d5aca0f81c64a Mon Sep 17 00:00:00 2001 From: Mansour Moufid Date: Tue, 17 Feb 2015 13:40:48 -0500 Subject: [PATCH] Add a rule for another type of memory leak to find-mem-leak.cocci. --- scripts/find-mem-leak.cocci | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/find-mem-leak.cocci b/scripts/find-mem-leak.cocci index a3f7ca99c..34cfd082d 100644 --- a/scripts/find-mem-leak.cocci +++ b/scripts/find-mem-leak.cocci @@ -7,3 +7,14 @@ statement S; ... * if (x == NULL || y == NULL) S + +@@ +expression x, y; +statement S; +@@ + if ( +* (x = polarssl_malloc(...)) == NULL + || +* (y = polarssl_malloc(...)) == NULL + ) + S