From b987c05d3083f3e03947d8d9316b8bb078ebcba2 Mon Sep 17 00:00:00 2001 From: Fenrir Date: Sun, 11 Feb 2018 18:29:41 -0700 Subject: [PATCH] Fix memory leak in Soc::init Ain't manual memory management grand? --- ctru-rs/src/services/soc.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/ctru-rs/src/services/soc.rs b/ctru-rs/src/services/soc.rs index b87748c..23cba3f 100644 --- a/ctru-rs/src/services/soc.rs +++ b/ctru-rs/src/services/soc.rs @@ -30,6 +30,7 @@ impl Soc { let r = socInit(soc_mem, num_bytes as u32); if r < 0 { + free(soc_mem as *mut _); Err(r.into()) } else { Ok(Soc { soc_mem, })