summaryrefslogtreecommitdiff
path: root/src/common/crypto.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-11-03 10:52:21 -0400
committerNick Mathewson <nickm@torproject.org>2016-11-03 10:52:21 -0400
commit957bdc4a42eca62f0c2d687fe13db7de56c5cb7b (patch)
tree4eaef08d3534c3e770700d23dd13c8cf4fc46afb /src/common/crypto.c
parent1eef543f9d9cde9754897047fb51ac7307b9827a (diff)
parent9b18b215bb34c4df1b94dec218c68a532c341e26 (diff)
downloadtor-957bdc4a42eca62f0c2d687fe13db7de56c5cb7b.tar.gz
tor-957bdc4a42eca62f0c2d687fe13db7de56c5cb7b.zip
Merge branch 'bug20553_028'
Diffstat (limited to 'src/common/crypto.c')
-rw-r--r--src/common/crypto.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 56409b47e2..fff516cc8e 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -743,14 +743,13 @@ crypto_pk_write_key_to_string_impl(crypto_pk_t *env, char **dest,
}
BIO_get_mem_ptr(b, &buf);
- (void)BIO_set_close(b, BIO_NOCLOSE); /* so BIO_free doesn't free buf */
- BIO_free(b);
*dest = tor_malloc(buf->length+1);
memcpy(*dest, buf->data, buf->length);
(*dest)[buf->length] = 0; /* nul terminate it */
*len = buf->length;
- BUF_MEM_free(buf);
+
+ BIO_free(b);
return 0;
}