Commit adb03224 authored by Daniel Salzman's avatar Daniel Salzman
Browse files

keymgr: fix possible memory leak

parent 54305ba0
Pipeline #11958 passed with stages
in 10 minutes and 11 seconds
......@@ -700,12 +700,14 @@ int keymgr_generate_dnskey(const knot_dname_t *dname, const knot_kasp_key_t *key
dnssec_binary_t pubkey = { 0 };
int ret = dnssec_key_get_pubkey(dnskey, &pubkey);
if (ret != DNSSEC_EOK) {
free(name);
return knot_error_from_libdnssec(ret);
}
uint8_t *base64_output = NULL;
int len = base64_encode_alloc(pubkey.data, pubkey.size, &base64_output);
if (len < 0) {
free(name);
return len;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment