diff --git a/src/select/hash.c b/src/select/hash.c
index 6fc08d7..bf7c741 100644
--- a/src/select/hash.c
+++ b/src/select/hash.c
@@ -856,8 +856,8 @@ css_error _insert_into_chain(css_selector_hash *ctx,
hash_entry *head,
 #endif

                if (prev == NULL) {
-                       entry->next = entry;
                        hash_entry temp = *entry;
+                       entry->next = entry;
                        *entry = *head;
                        *head = temp;
                } else {

Reply via email to