fixed memleak in openssl fingerprinting

This commit is contained in:
Martin Willi 2009-08-27 10:40:49 +02:00
parent b12c6d163d
commit 1a8ef8aabc
2 changed files with 2 additions and 0 deletions

View 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;
}

View 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;