]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
ipseckey: Properly free public key after creating certificate
authorTobias Brunner <tobias@strongswan.org>
Tue, 13 Sep 2016 12:15:41 +0000 (14:15 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 20 Sep 2016 13:36:15 +0000 (15:36 +0200)
src/libcharon/plugins/ipseckey/ipseckey_cred.c

index 6c041ce268f19a291126d852c70c2a434398dc99..6f85994a2090af59d23ff1e92928be4b6d75794b 100644 (file)
@@ -105,11 +105,11 @@ METHOD(enumerator_t, cert_enumerator_enumerate, bool,
                                                                   BUILD_NOT_BEFORE_TIME, this->notBefore,
                                                                   BUILD_NOT_AFTER_TIME, this->notAfter,
                                                                   BUILD_END);
+               public->destroy(public);
                if (*cert == NULL)
                {
                        DBG1(DBG_CFG, "  failed to create certificate from IPSECKEY");
                        cur_ipseckey->destroy(cur_ipseckey);
-                       public->destroy(public);
                        continue;
                }
                cur_ipseckey->destroy(cur_ipseckey);