fix identation and prevent tiny memleaks that could occur if R_NEW0 fails