From ab0e339e80bef649b13fddd6a3c0fc7a2d5b5df3 Mon Sep 17 00:00:00 2001 From: Nikolaus Rath Date: Wed, 27 Nov 2019 10:54:13 +0000 Subject: Protect changes to conn->req_count with mutex. --- sshfs.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sshfs.c') diff --git a/sshfs.c b/sshfs.c index 0d3e562..8d12d07 100644 --- a/sshfs.c +++ b/sshfs.c @@ -1393,7 +1393,9 @@ static int sftp_read(struct conn *conn, uint8_t *type, struct buffer *buf) static void request_free(struct request *req) { + pthread_mutex_lock(&sshfs.lock); req->conn->req_count--; + pthread_mutex_unlock(&sshfs.lock); buf_free(&req->reply); sem_destroy(&req->ready); g_free(req); -- cgit v1.2.3