Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add judgment before use acceptor.plv

Signed-off-by: Guangliang Zhao <gzhao@suse.com>
  • Loading branch information...
commit 8a74043d6dbeda93eb5eb552766d12c4c060a454 1 parent ed5d41b
@glzhao glzhao authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/paxos_lease.c
View
6 src/paxos_lease.c
@@ -723,6 +723,9 @@ static int start_lease_learned(pi_handle_t handle, void *extra, int round)
return -1;
}
+ if (!pl->acceptor.plv)
+ return -1;
+
pl->release = LEASE_STARTED;
pl->owner = pl->acceptor.plv->owner;
pl->expiry = pl->acceptor.plv->expiry;
@@ -759,6 +762,9 @@ static int stop_lease_learned(pi_handle_t handle,
return -1;
}
+ if (!pl->acceptor.plv)
+ return -1;
+
if (pl->acceptor.timer2)
del_timer(&pl->acceptor.timer2);
if (pl->acceptor.timer1)
Please sign in to comment.
Something went wrong with that request. Please try again.