1 /* C only: C++ exceptions cause a malloc leak after "safer" returns.
2 Therefore this test has been duplicated as
3 c-c++-common/analyzer/pr109577-noexcept.c */
5 void *malloc (__SIZE_TYPE__
);
8 unsafe (__SIZE_TYPE__ n
)
10 return (double *) malloc (n
* sizeof (double));
14 safer (__SIZE_TYPE__ n
)
17 if (__builtin_mul_overflow (n
, sizeof (double), &nbytes
))
19 return (double *) malloc (nbytes
); /* Exceptions enabled cause a leak here. */