]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
fixed memleak in openssl fingerprinting
authorMartin Willi <martin@strongswan.org>
Thu, 27 Aug 2009 08:40:49 +0000 (10:40 +0200)
committerMartin Willi <martin@strongswan.org>
Thu, 27 Aug 2009 08:40:49 +0000 (10:40 +0200)
src/libstrongswan/plugins/openssl/openssl_ec_public_key.c
src/libstrongswan/plugins/openssl/openssl_rsa_public_key.c

index a290f3d055137dfc2a99a825b6a0b3a67ee5416d..d1b3a4e392f5b86ba385944ef1be134db7a5f8e9 100644 (file)
@@ -230,6 +230,7 @@ bool openssl_ec_fingerprint(EC_KEY *ec, key_encoding_type_t type, chunk_t *fp)
        }
        hasher->allocate_hash(hasher, key, fp);
        hasher->destroy(hasher);
+       free(key.ptr);
        lib->encoding->cache(lib->encoding, type, ec, *fp);
        return TRUE;
 }
index 880a4613e266ebee46a6dd31a80f80248df1e731..c20af907a7a3f61acdf97915b297172b2c98d973 100644 (file)
@@ -205,6 +205,7 @@ bool openssl_rsa_fingerprint(RSA *rsa, key_encoding_type_t type, chunk_t *fp)
                return FALSE;
        }
        hasher->allocate_hash(hasher, key, fp);
+       free(key.ptr);
        hasher->destroy(hasher);
        lib->encoding->cache(lib->encoding, type, rsa, *fp);
        return TRUE;