From: Daniel Salzman Date: Wed, 15 Dec 2021 15:14:36 +0000 (+0100) Subject: libdnssec: fix memleak when pkcs8_import_key() fails X-Git-Tag: v3.3.dev~246 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d978024dfe7b4bbb26ba9709aec0e098a1214132;p=thirdparty%2Fknot-dns.git libdnssec: fix memleak when pkcs8_import_key() fails --- diff --git a/src/libdnssec/keystore/pkcs8.c b/src/libdnssec/keystore/pkcs8.c index 36785feb69..5473aaaf77 100644 --- a/src/libdnssec/keystore/pkcs8.c +++ b/src/libdnssec/keystore/pkcs8.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 CZ.NIC, z.s.p.o. +/* Copyright (C) 2021 CZ.NIC, z.s.p.o. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -358,6 +358,7 @@ static int pkcs8_import_key(void *ctx, const dnssec_binary_t *pem, char **id_ptr *id_ptr = id; return DNSSEC_EOK; } + free(id); return r; }