From 9c5139092f729dc7af0abe30c64971e5729e4016 Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Wed, 20 Oct 2010 19:53:43 -0400 Subject: [PATCH] Increment the cache refcount after locking the file mutex, not before. --- src/commands.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/commands.c b/src/commands.c index 2b109465..3902dd46 100644 --- a/src/commands.c +++ b/src/commands.c @@ -625,7 +625,6 @@ static gpg_error_t open_command_common(assuan_context_t ctx, gchar *line) } } - cache_incr_refcount(client->md5file); CACHE_UNLOCK; rc = lock_file_mutex(client); @@ -635,6 +634,9 @@ static gpg_error_t open_command_common(assuan_context_t ctx, gchar *line) } client->freed = FALSE; + CACHE_LOCK(client->ctx); + cache_incr_refcount(client->md5file); + CACHE_UNLOCK; client->crypto = init_client_crypto(); if (!client->crypto) { -- 2.11.4.GIT