hash_table.c possible BUGFIX, do not change cb_data before locking mutex
diff --git a/src/hash_table.c b/src/hash_table.c
index 090def8..28731e1 100644
--- a/src/hash_table.c
+++ b/src/hash_table.c
@@ -144,14 +144,14 @@
len = strlen(value);
hash = dict_hash(value, len);
- /* set len as data for compare callback*/
- lyht_set_cb_data(ctx->dict.hash_tab, (void *)&len);
/* create record for lyht_find call */
rec.value = (char *)value;
rec.refcount = 0;
pthread_mutex_lock(&ctx->dict.lock);
+ /* set len as data for compare callback*/
+ lyht_set_cb_data(ctx->dict.hash_tab, (void *)&len);
ret = lyht_find(ctx->dict.hash_tab, &rec, hash, (void **)&match);
if ((ret == 0) && match) {