apps: Guard against some possible memory leaks in the cases Init is called twice.