Skip to content

Commit

Permalink
Protect changes to conn->req_count with mutex.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikratio committed Nov 27, 2019
1 parent b19e3b8 commit ab0e339
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sshfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ab0e339

Please sign in to comment.