mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-22 13:02:38 +02:00
Clear allocated tmem.
This commit is contained in:
parent
07ec16a8e7
commit
20a549b46b
@ -1,4 +1,5 @@
|
|||||||
// Copyright 2017 plutoo
|
// Copyright 2017 plutoo
|
||||||
|
#include <string.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "result.h"
|
#include "result.h"
|
||||||
@ -20,6 +21,8 @@ Result tmemCreate(TransferMemory* t, size_t size, Permission perm)
|
|||||||
rc = MAKERESULT(Module_Libnx, LibnxError_OutOfMemory);
|
rc = MAKERESULT(Module_Libnx, LibnxError_OutOfMemory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
memset(t->src_addr, 0, size);
|
||||||
|
|
||||||
if (R_SUCCEEDED(rc)) {
|
if (R_SUCCEEDED(rc)) {
|
||||||
rc = svcCreateTransferMemory(&t->handle, t->src_addr, size, perm);
|
rc = svcCreateTransferMemory(&t->handle, t->src_addr, size, perm);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user