aboutsummaryrefslogtreecommitdiff
path: root/thirdparty/nRF5_SDK_15.0.0_a53641a/external/mbedtls/scripts/find-mem-leak.cocci
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2018-08-23 17:08:59 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2018-08-23 17:12:21 +0200
commit3061ecca3d0fdfb87dabbf5f63c9e06c2a30f53a (patch)
treeab49cc16ed0b853452c5c2ed2d3042416d628986 /thirdparty/nRF5_SDK_15.0.0_a53641a/external/mbedtls/scripts/find-mem-leak.cocci
downloadiot-sensors-3061ecca3d0fdfb87dabbf5f63c9e06c2a30f53a.tar.gz
iot-sensors-3061ecca3d0fdfb87dabbf5f63c9e06c2a30f53a.tar.bz2
iot-sensors-3061ecca3d0fdfb87dabbf5f63c9e06c2a30f53a.tar.xz
iot-sensors-3061ecca3d0fdfb87dabbf5f63c9e06c2a30f53a.zip
o Initial import.HEADmaster
Diffstat (limited to 'thirdparty/nRF5_SDK_15.0.0_a53641a/external/mbedtls/scripts/find-mem-leak.cocci')
-rw-r--r--thirdparty/nRF5_SDK_15.0.0_a53641a/external/mbedtls/scripts/find-mem-leak.cocci20
1 files changed, 20 insertions, 0 deletions
diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/mbedtls/scripts/find-mem-leak.cocci b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/mbedtls/scripts/find-mem-leak.cocci
new file mode 100644
index 0000000..5cfe452
--- /dev/null
+++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/mbedtls/scripts/find-mem-leak.cocci
@@ -0,0 +1,20 @@
+@@
+expression x, y;
+statement S;
+@@
+ x = mbedtls_malloc(...);
+ y = mbedtls_malloc(...);
+ ...
+* if (x == NULL || y == NULL)
+ S
+
+@@
+expression x, y;
+statement S;
+@@
+ if (
+* (x = mbedtls_malloc(...)) == NULL
+ ||
+* (y = mbedtls_malloc(...)) == NULL
+ )
+ S