Skip to content

Commit

Permalink
we need to free this, so include cstdlib
Browse files Browse the repository at this point in the history
  • Loading branch information
TurtleP committed Nov 2, 2022
1 parent 91ed2c5 commit 3140f1c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions platform/ctr/source/runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include <utilities/results.hpp>

#include <cstdlib>

#define SOC_BUFSIZE 0x100000
#define BUFFER_ALIGN 0x1000

Expand All @@ -19,7 +21,7 @@ extern "C"

R_ABORT_UNLESS(frdInit());

SOCKET_BUFFER = (uint32_t*)memalign(BUFFER_ALIGN, SOC_BUFSIZE);
SOCKET_BUFFER = (uint32_t*)aligned_alloc(BUFFER_ALIGN, SOC_BUFSIZE);
R_ABORT_LAMBDA_UNLESS(socInit(SOCKET_BUFFER, SOC_BUFSIZE), [&]() { free(SOCKET_BUFFER); });

R_ABORT_UNLESS(ptmuInit());
Expand All @@ -42,7 +44,7 @@ extern "C"
mcuHwcExit();

socExit();
free(SOCKET_BUFFER);
std::free(SOCKET_BUFFER);

frdExit();

Expand Down

0 comments on commit 3140f1c

Please sign in to comment.