From: Nick Mathewson Date: Sun, 23 Oct 2011 16:30:16 +0000 (-0400) Subject: Fix memory leak in prop176 code X-Git-Tag: tor-0.2.3.6-alpha~21 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=80cf342e476f21b607f2088a6565bee93b1e08b0;p=thirdparty%2Ftor.git Fix memory leak in prop176 code This fixes part of bug4252. Bug not in any released version. --- diff --git a/src/common/tortls.c b/src/common/tortls.c index 9a3c02b5b3..e540bfdc14 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -864,8 +864,8 @@ tor_tls_get_my_client_auth_key(void) } /** - * Return the public key that a cetificate certifies. Return NULL if the - * cert's key is not RSA. + * Return a newly allocated copy of the public key that a certificate + * certifies. Return NULL if the cert's key is not RSA. */ crypto_pk_env_t * tor_tls_cert_get_key(tor_cert_t *cert) diff --git a/src/or/command.c b/src/or/command.c index 1b8ddb30d2..49c9880e31 100644 --- a/src/or/command.c +++ b/src/or/command.c @@ -1190,6 +1190,7 @@ command_process_authenticate_cell(var_cell_t *cell, or_connection_t *conn) signed_len = crypto_pk_public_checksig(pk, signed_data, keysize, (char*)auth + V3_AUTH_BODY_LEN, authlen - V3_AUTH_BODY_LEN); + crypto_free_pk_env(pk); if (signed_len < 0) { tor_free(signed_data); ERR("Signature wasn't valid");