size_t n; std::cin >> n; int* arr = new int[n]; ... // Control flow must reach exactly one corresponding delete[] !!! delete[] arr;