fix memleak in resolve passwd