sysroot: fix several memory leaks

1 job for wip/tintou/sysroot-leaks in 23 minutes and 52 seconds (queued for 2 seconds)