find-mem-leak.cocci 269 B

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