src: don't initialize variable before assignment
src: fix potential memory leak on early return