aboutsummaryrefslogtreecommitdiff
path: root/lib/mbedtls-2.27.0/scripts/find-mem-leak.cocci
blob: 8179e2b3ebd901e3d43a80f3312d1ecc315979a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
@@
expression x, y;
statement S;
@@
  x = mbedtls_calloc(...);
  y = mbedtls_calloc(...);
  ...
* if (x == NULL || y == NULL)
    S

@@
expression x, y;
statement S;
@@
  if (
*   (x = mbedtls_calloc(...)) == NULL
    ||
*   (y = mbedtls_calloc(...)) == NULL
  )
    S