mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2025-01-03 19:14:44 +00:00
erpt: fix 0x100 byte memory leak on creation of new report
This commit is contained in:
parent
e086022b77
commit
c362838e11
2 changed files with 4 additions and 1 deletions
|
@ -94,6 +94,9 @@ namespace ams::erpt::srv {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data_size > 0) {
|
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<u8 *>(AllocateWithAlign(data_size, alignof(u64)));
|
this->ctx.array_buffer = static_cast<u8 *>(AllocateWithAlign(data_size, alignof(u64)));
|
||||||
R_UNLESS(this->ctx.array_buffer != nullptr, erpt::ResultOutOfMemory());
|
R_UNLESS(this->ctx.array_buffer != nullptr, erpt::ResultOutOfMemory());
|
||||||
|
|
||||||
|
|
|
@ -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) {
|
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. */
|
/* Create a context record for the report. */
|
||||||
auto record = std::make_unique<ContextRecord>(CategoryId_ErrorInfoAuto);
|
auto record = std::make_unique<ContextRecord>();
|
||||||
R_UNLESS(record != nullptr, erpt::ResultOutOfMemory());
|
R_UNLESS(record != nullptr, erpt::ResultOutOfMemory());
|
||||||
|
|
||||||
/* Initialize the record. */
|
/* Initialize the record. */
|
||||||
|
|
Loading…
Reference in a new issue