From 92a3d49f72001478966a0528b3c9a25ae552fb06 Mon Sep 17 00:00:00 2001 From: BernardoGiordano Date: Tue, 23 Apr 2019 19:21:53 +0200 Subject: [PATCH] enable lto and fix memory leak --- 3ds/Makefile | 2 +- 3ds/source/title.cpp | 2 +- switch/source/title.cpp | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/3ds/Makefile b/3ds/Makefile index 7e4763e..bcdc3cf 100644 --- a/3ds/Makefile +++ b/3ds/Makefile @@ -74,7 +74,7 @@ ICON_FLAGS := nosavebackups,visible #--------------------------------------------------------------------------------- ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -CFLAGS := -g -Wall -Wextra -Wno-psabi -O2 -mword-relocations \ +CFLAGS := -g -Wall -Wextra -Wno-psabi -O2 -mword-relocations -flto \ -fomit-frame-pointer -ffunction-sections \ $(ARCH) \ -DVERSION_MAJOR=${VERSION_MAJOR} \ diff --git a/3ds/source/title.cpp b/3ds/source/title.cpp index 17fd41e..b52db98 100644 --- a/3ds/source/title.cpp +++ b/3ds/source/title.cpp @@ -960,7 +960,7 @@ static bool scanCard(void) isScanning = true; } - bool ret; + bool ret = false; Result res = 0; u32 count = 0; FS_CardType cardType; diff --git a/switch/source/title.cpp b/switch/source/title.cpp index 99cdae0..d636c39 100644 --- a/switch/source/title.cpp +++ b/switch/source/title.cpp @@ -218,6 +218,7 @@ void loadTitles(void) Result res = fsOpenSaveDataIterator(&iterator, FsSaveDataSpaceId_NandUser); if (R_FAILED(res)) { + free(nsacd); return; }