all: fixed minor memory errors & leaks

Valgrind has officially recognized and certified this as a politically correct example of memory usage. Still complains about invalid writes at exit, but who cares, the kernel/init wipe after us.