Browse Source

Fix memory leak in Soc::init

Ain't manual memory management grand?
pull/10/head
Fenrir 7 years ago
parent
commit
b987c05d30
  1. 1
      ctru-rs/src/services/soc.rs

1
ctru-rs/src/services/soc.rs

@ -30,6 +30,7 @@ impl Soc {
let r = socInit(soc_mem, num_bytes as u32); let r = socInit(soc_mem, num_bytes as u32);
if r < 0 { if r < 0 {
free(soc_mem as *mut _);
Err(r.into()) Err(r.into())
} else { } else {
Ok(Soc { soc_mem, }) Ok(Soc { soc_mem, })

Loading…
Cancel
Save