mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 22:45:39 +00:00
Add directory to dst_key structure
Store key directory when reading the key from file. This is the directory it was read from and can be used when saving the key back to disk.
This commit is contained in:
@@ -691,6 +691,10 @@ dst_key_fromnamedfile(const char *filename, const char *dirname, int type,
|
||||
}
|
||||
|
||||
key->modified = false;
|
||||
|
||||
if (dirname != NULL) {
|
||||
key->directory = isc_mem_strdup(mctx, dirname);
|
||||
}
|
||||
*keyp = key;
|
||||
key = NULL;
|
||||
|
||||
@@ -1395,6 +1399,9 @@ dst_key_free(dst_key_t **keyp) {
|
||||
INSIST(key->func->destroy != NULL);
|
||||
key->func->destroy(key);
|
||||
}
|
||||
if (key->directory != NULL) {
|
||||
isc_mem_free(mctx, key->directory);
|
||||
}
|
||||
if (key->engine != NULL) {
|
||||
isc_mem_free(mctx, key->engine);
|
||||
}
|
||||
|
Reference in New Issue
Block a user