fix: possible null-pointer dereferencement
fix: small and one-shot memory leak