find-mem-leak.cocci 269 B

1234567891011121314151617181920
  1. @@
  2. expression x, y;
  3. statement S;
  4. @@
  5. x = mbedtls_calloc(...);
  6. y = mbedtls_calloc(...);
  7. ...
  8. * if (x == NULL || y == NULL)
  9. S
  10. @@
  11. expression x, y;
  12. statement S;
  13. @@
  14. if (
  15. * (x = mbedtls_calloc(...)) == NULL
  16. ||
  17. * (y = mbedtls_calloc(...)) == NULL
  18. )
  19. S