summaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 0600d9711f..ddcf08c160 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -311,6 +311,9 @@ _connection_free(connection_t *conn)
{
void *mem;
size_t memlen;
+ if (!conn)
+ return;
+
switch (conn->type) {
case CONN_TYPE_OR:
tor_assert(conn->magic == OR_CONNECTION_MAGIC);
@@ -432,7 +435,8 @@ _connection_free(connection_t *conn)
void
connection_free(connection_t *conn)
{
- tor_assert(conn);
+ if (!conn)
+ return;
tor_assert(!connection_is_on_closeable_list(conn));
tor_assert(!connection_in_array(conn));
if (conn->linked_conn) {