Commit Diff


commit - 83baff54228956d9f7bbe45b9765d11cbabc72d7
commit + 963ecf2aec9d6486181317fb0258fec9b728da0f
blob - 85026493061b79ef904116f9e27e8d9ac658f2c5
blob + bc0c94f264932a3e4abc8e303478ed0b408b8bda
--- tog/tog.c
+++ tog/tog.c
@@ -860,8 +860,8 @@ done:
 	}
 
 	errcode = pthread_mutex_unlock(&tog_mutex);
-	if (errcode)
-		return got_error_set_errno(errcode, "pthread_mutex_unlock");
+	if (errcode && err == NULL)
+		err = got_error_set_errno(errcode, "pthread_mutex_unlock");
 
 	return err;
 }