Fix memory leak on slave resolve failure.