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, })