diff --git a/common/memory.c b/common/memory.c index 5d4883c3..13bc9b21 100644 --- a/common/memory.c +++ b/common/memory.c @@ -400,6 +400,7 @@ int supersede_lease (comp, lease, commit) comp -> hardware_addr.hlen))))) { warn ("Lease conflict at %s", piaddr (comp -> ip_addr)); + return 0; } else { /* If there's a Unique ID, dissociate it from the hash table if necessary, and always free it. */ @@ -650,7 +651,8 @@ void write_leases () write_lease (l); } } - commit_leases (); + if (!commit_leases ()) + error ("Can't commit leases to new database: %m"); } void dump_subnets () diff --git a/memory.c b/memory.c index 5d4883c3..13bc9b21 100644 --- a/memory.c +++ b/memory.c @@ -400,6 +400,7 @@ int supersede_lease (comp, lease, commit) comp -> hardware_addr.hlen))))) { warn ("Lease conflict at %s", piaddr (comp -> ip_addr)); + return 0; } else { /* If there's a Unique ID, dissociate it from the hash table if necessary, and always free it. */ @@ -650,7 +651,8 @@ void write_leases () write_lease (l); } } - commit_leases (); + if (!commit_leases ()) + error ("Can't commit leases to new database: %m"); } void dump_subnets ()