3761. [bug] Address dangling reference bug in dns_keytable_add.

[RT #35471]

(cherry picked from commit 96c17c5ecb)
This commit is contained in:
Mark Andrews
2014-02-27 16:56:39 +11:00
parent 71fac8ec0f
commit 6c90e655bf
2 changed files with 5 additions and 1 deletions
+3
View File
@@ -1,3 +1,6 @@
3761. [bug] Address dangling reference bug in dns_keytable_add.
[RT #35471]
3757. [port] Enable Python tools (dnssec-coverage,
dnssec-checkds) to run on Windows. [RT #34355]
+2 -1
View File
@@ -174,6 +174,7 @@ insert(dns_keytable_t *keytable, isc_boolean_t managed,
for (k = node->data; k != NULL; k = k->next) {
if (k->key == NULL) {
k->key = *keyp;
*keyp = NULL; /* transfer ownership */
break;
}
if (dst_key_compare(k->key, *keyp) == ISC_TRUE)
@@ -182,7 +183,7 @@ insert(dns_keytable_t *keytable, isc_boolean_t managed,
if (k == NULL)
result = ISC_R_SUCCESS;
else
else if (*keyp != NULL)
dst_key_free(keyp);
}