Changing the ret variable scope to local

Why to expose this variable to global scope ? It's not intentionally made, right ?