Lines Matching full:allocation
7 allocated memory by the first ``new`` may leak if the second allocation fails
11 operator or arguments of a function. Therefore if a first allocation succeeds
13 allocation has failed and free the memory. Even if the order is fixed the result
15 at the time when a second allocation fails. It is best to avoid any expression
17 used to check for allocation errors.
64 // Allocation of 'B'/'A' may fail after memory for 'A'/'B' was allocated.
65 …f(new A, new B); // warning: memory allocation may leak if an other allocation is sequenced after …
70 …// Allocation of 'B'/'A' may fail after memory for 'A'/'B' was allocated but not yet passed to fun…
71 …int X = f1(new A) + f1(new B); // warning: memory allocation may leak if an other allocation is se…
73 // Allocation of 'B' may fail after memory for 'A' was allocated.
74 … // From C++17 on memory for 'B' is allocated first but still may leak if allocation of 'A' fails.
75 …PtrB = new B(new A); // warning: memory allocation may leak if an other allocation is sequenced af…
79 … new A)->Var = (PtrB = new B)->Var; // warning: memory allocation may leak if an other allocation …
91 // No warning if at least one non-throwing allocation is used.
96 …// No warning if the allocation is outside a try block (or no catch handler exists for std::bad_al…