summaryrefslogtreecommitdiff
path: root/src/lib/tls
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-09-04 20:46:46 -0400
committerNick Mathewson <nickm@torproject.org>2018-09-04 20:46:46 -0400
commit03efb67b42ce88ca6073eadc1b66d6151d646607 (patch)
tree1d74fcd4dda50c92feee66580bb3e653d72085b4 /src/lib/tls
parenteeba944ee0a642ef105b639f1bb0580fae28d3ab (diff)
downloadtor-03efb67b42ce88ca6073eadc1b66d6151d646607.tar.gz
tor-03efb67b42ce88ca6073eadc1b66d6151d646607.zip
Debug one last reference-counting issue that only appeared on openssl master
Diffstat (limited to 'src/lib/tls')
-rw-r--r--src/lib/tls/tortls_openssl.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/tls/tortls_openssl.c b/src/lib/tls/tortls_openssl.c
index ab9712962b..cfe859adf3 100644
--- a/src/lib/tls/tortls_openssl.c
+++ b/src/lib/tls/tortls_openssl.c
@@ -1380,8 +1380,7 @@ tor_tls_get_own_cert,(tor_tls_t *tls))
* *<b>id_cert_out</b> respectively. Log all messages at level
* <b>severity</b>.
*
- * Note that a reference is added to cert_out, so it needs to be
- * freed. id_cert_out doesn't. */
+ * Note that a reference is added both of the returned certificates. */
MOCK_IMPL(void,
try_to_extract_certs_from_tls,(int severity, tor_tls_t *tls,
X509 **cert_out, X509 **id_cert_out))
@@ -1411,7 +1410,7 @@ try_to_extract_certs_from_tls,(int severity, tor_tls_t *tls,
if (X509_cmp(id_cert, cert) != 0)
break;
}
- *id_cert_out = id_cert;
+ *id_cert_out = id_cert ? X509_dup(id_cert) : NULL;
}
/** Return the number of bytes available for reading from <b>tls</b>.