Clear allocated tmem.

This commit is contained in:
yellows8 2018-03-01 22:55:17 -05:00
parent 07ec16a8e7
commit 20a549b46b

View File

@ -1,4 +1,5 @@
// Copyright 2017 plutoo
#include <string.h>
#include <malloc.h>
#include "types.h"
#include "result.h"
@ -20,6 +21,8 @@ Result tmemCreate(TransferMemory* t, size_t size, Permission perm)
rc = MAKERESULT(Module_Libnx, LibnxError_OutOfMemory);
}
memset(t->src_addr, 0, size);
if (R_SUCCEEDED(rc)) {
rc = svcCreateTransferMemory(&t->handle, t->src_addr, size, perm);
}