Spot the bug in record import cleanup

from Exceptions
C++23 (GCC 13.3.0) beginner 4 min 1 issue to find

Find the resource-lifetime failure in this generated import helper.

C++
void import_records(std::size_t count) {
    auto* buffer = new Record[count];
    read_records(buffer, count);
    validate_records(buffer, count);
    delete[] buffer;
}
Open in playground
Report an error