diff options
author | Ted Lemon <source@isc.org> | 1996-06-12 04:05:23 +0000 |
---|---|---|
committer | Ted Lemon <source@isc.org> | 1996-06-12 04:05:23 +0000 |
commit | 70219773219b5a141caadead3d07d43d47cf3ca7 (patch) | |
tree | 8da0c8988bbad40a3000e6502691953aebffb591 /common | |
parent | 1a4b272feb64078c60ce3b28a0ffc82a709f36a3 (diff) | |
download | isc-dhcp-70219773219b5a141caadead3d07d43d47cf3ca7.tar.gz |
Don't free comp -> uid if comp == lease
Diffstat (limited to 'common')
-rw-r--r-- | common/memory.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/common/memory.c b/common/memory.c index 13bc9b21..9e9ef6f9 100644 --- a/common/memory.c +++ b/common/memory.c @@ -405,15 +405,17 @@ int supersede_lease (comp, lease, commit) /* If there's a Unique ID, dissociate it from the hash table if necessary, and always free it. */ if (comp -> uid) { - if (comp -> uid_len != lease -> uid_len || - memcmp (comp -> uid, lease -> uid, - comp -> uid_len)) { - delete_hash_entry (lease_uid_hash, - comp -> uid, - comp -> uid_len); - enter_uid = 1; + if (comp -> uid != lease -> uid) { + if (comp -> uid_len != lease -> uid_len || + memcmp (comp -> uid, lease -> uid, + comp -> uid_len)) { + delete_hash_entry (lease_uid_hash, + comp -> uid, + comp -> uid_len); + enter_uid = 1; + } + free (comp -> uid); } - free (comp -> uid); } else enter_uid = 1; |