diff --git a/libraries/libstratosphere/source/erpt/srv/erpt_srv_context_record.cpp b/libraries/libstratosphere/source/erpt/srv/erpt_srv_context_record.cpp index 7019b7e63..039fc376b 100644 --- a/libraries/libstratosphere/source/erpt/srv/erpt_srv_context_record.cpp +++ b/libraries/libstratosphere/source/erpt/srv/erpt_srv_context_record.cpp @@ -94,6 +94,9 @@ namespace ams::erpt::srv { } if (data_size > 0) { + /* If array buffer isn't nullptr, we'll leak memory here, so verify that it is. */ + AMS_ABORT_UNLESS(this->ctx.array_buffer == nullptr); + this->ctx.array_buffer = static_cast(AllocateWithAlign(data_size, alignof(u64))); R_UNLESS(this->ctx.array_buffer != nullptr, erpt::ResultOutOfMemory()); diff --git a/libraries/libstratosphere/source/erpt/srv/erpt_srv_reporter.cpp b/libraries/libstratosphere/source/erpt/srv/erpt_srv_reporter.cpp index 9704eda89..2c6daeec7 100644 --- a/libraries/libstratosphere/source/erpt/srv/erpt_srv_reporter.cpp +++ b/libraries/libstratosphere/source/erpt/srv/erpt_srv_reporter.cpp @@ -409,7 +409,7 @@ namespace ams::erpt::srv { Result Reporter::CreateReport(ReportType type, Result ctx_result, const ContextEntry *ctx, const u8 *data, u32 data_size, const ReportMetaData *meta, const AttachmentId *attachments, u32 num_attachments) { /* Create a context record for the report. */ - auto record = std::make_unique(CategoryId_ErrorInfoAuto); + auto record = std::make_unique(); R_UNLESS(record != nullptr, erpt::ResultOutOfMemory()); /* Initialize the record. */