[Issue 10151] Leaks in do_syncrep2() when error handling