3440. [bug] Reorder get_key_struct to not trigger a assertion when
cleaning up due to out of memory error. [RT #32131]
This commit is contained in:
3
CHANGES
3
CHANGES
@@ -1,3 +1,6 @@
|
||||
3440. [bug] Reorder get_key_struct to not trigger a assertion when
|
||||
cleaning up due to out of memory error. [RT #32131]
|
||||
|
||||
3439. [placeholder]
|
||||
|
||||
3438. [bug] Don't accept unknown data escape in quotes. [RT #32031]
|
||||
|
||||
@@ -1326,24 +1326,24 @@ get_key_struct(dns_name_t *name, unsigned int alg,
|
||||
return (NULL);
|
||||
|
||||
memset(key, 0, sizeof(dst_key_t));
|
||||
key->magic = KEY_MAGIC;
|
||||
|
||||
result = isc_refcount_init(&key->refs, 1);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
isc_mem_put(mctx, key, sizeof(dst_key_t));
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
key->key_name = isc_mem_get(mctx, sizeof(dns_name_t));
|
||||
if (key->key_name == NULL) {
|
||||
isc_refcount_destroy(&key->refs);
|
||||
isc_mem_put(mctx, key, sizeof(dst_key_t));
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
dns_name_init(key->key_name, NULL);
|
||||
result = dns_name_dup(name, mctx, key->key_name);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
isc_refcount_destroy(&key->refs);
|
||||
isc_mem_put(mctx, key->key_name, sizeof(dns_name_t));
|
||||
isc_mem_put(mctx, key, sizeof(dst_key_t));
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
result = isc_refcount_init(&key->refs, 1);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
dns_name_free(key->key_name, mctx);
|
||||
isc_mem_put(mctx, key->key_name, sizeof(dns_name_t));
|
||||
isc_mem_put(mctx, key, sizeof(dst_key_t));
|
||||
return (NULL);
|
||||
@@ -1363,6 +1363,7 @@ get_key_struct(dns_name_t *name, unsigned int alg,
|
||||
key->times[i] = 0;
|
||||
key->timeset[i] = ISC_FALSE;
|
||||
}
|
||||
key->magic = KEY_MAGIC;
|
||||
return (key);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user