diff --git a/src/refbuf.c b/src/refbuf.c index ac9dc14f..c4cd853f 100644 --- a/src/refbuf.c +++ b/src/refbuf.c @@ -66,6 +66,8 @@ void refbuf_addref(refbuf_t *self) void refbuf_release(refbuf_t *self) { + if (self == NULL) + return; self->_count--; if (self->_count == 0) { while (self->associated) @@ -76,7 +78,6 @@ void refbuf_release(refbuf_t *self) } free(self->data); free(self); - return; } } diff --git a/src/slave.c b/src/slave.c index e127cb64..6932835f 100644 --- a/src/slave.c +++ b/src/slave.c @@ -243,9 +243,10 @@ static void *start_relay_stream (void *arg) /* make sure only the client_destory frees these */ con = NULL; parser = NULL; - streamsock = SOCK_ERROR; break; } + con = NULL; + parser = NULL; client_set_queue (src->client, NULL); if (connection_complete_source (src, 0) < 0) @@ -286,8 +287,6 @@ static void *start_relay_stream (void *arg) avl_tree_unlock (global.source_tree); } - if (con == NULL && streamsock != SOCK_ERROR) - sock_close (streamsock); if (con) connection_close (con); src->con = NULL;