dict BUGFIX unsafe variable read
diff --git a/src/dict.c b/src/dict.c
index 885322b..f603f9b 100644
--- a/src/dict.c
+++ b/src/dict.c
@@ -116,7 +116,7 @@
uint32_t index;
struct dict_rec *record, *prev = NULL;
- if (!value || !ctx || !ctx->dict.used) {
+ if (!value || !ctx) {
return;
}
@@ -124,6 +124,11 @@
pthread_mutex_lock(&ctx->dict.lock);
+ if (!ctx->dict.used) {
+ pthread_mutex_unlock(&ctx->dict.lock);
+ return;
+ }
+
index = dict_hash(value, len) & ctx->dict.hash_mask;
record = &ctx->dict.recs[index];