diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c index d0eceee62f9..673c99c3d34 100644 --- a/ctdb/server/ctdb_recoverd.c +++ b/ctdb/server/ctdb_recoverd.c @@ -956,17 +956,18 @@ static bool ctdb_recovery_lock(struct ctdb_recoverd *rec) return false; } + rec->recovery_lock_handle = s; + s->h = h; + while (! s->done) { tevent_loop_once(ctdb->ev); } if (! s->locked) { - talloc_free(s); + TALLOC_FREE(rec->recovery_lock_handle); return false; } - rec->recovery_lock_handle = s; - s->h = h; ctdb_ctrl_report_recd_lock_latency(ctdb, CONTROL_TIMEOUT(), s->latency);