]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
libtls: Fix double-free when enumerating private keys
authorTobias Brunner <tobias@strongswan.org>
Fri, 22 Aug 2025 09:46:52 +0000 (11:46 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 22 Aug 2025 10:07:55 +0000 (12:07 +0200)
src/libtls/tls_crypto.c

index 04fc8201ac0fa95bb0ead7ded04f8e199cf813cc..2d9b8b7c26315c4bda6602735fc3a28738bbc29f 100644 (file)
@@ -2774,6 +2774,7 @@ METHOD(enumerator_t, private_key_enumerate, bool,
        VA_ARGS_VGET(args, key_out, auth_out);
 
        DESTROY_IF(this->key);
+       this->key = NULL;
        DESTROY_IF(this->auth);
        this->auth = auth_cfg_create();