]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
libdnssec: fix memleak when pkcs8_import_key() fails
authorDaniel Salzman <daniel.salzman@nic.cz>
Wed, 15 Dec 2021 15:14:36 +0000 (16:14 +0100)
committerDaniel Salzman <daniel.salzman@nic.cz>
Wed, 15 Dec 2021 15:15:33 +0000 (16:15 +0100)
src/libdnssec/keystore/pkcs8.c

index 36785feb69afd154bce71e42e8c7bad63337bbf3..5473aaaf7761881b98d1ea0493afc44d24b3ab08 100644 (file)
@@ -1,4 +1,4 @@
-/*  Copyright (C) 2020 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/*  Copyright (C) 2021 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
 
     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;
        }