commit | 9d6befd82674a3a7e5fb371a1cdd867459328d9d | [log] [tgz] |
---|---|---|
author | Michal Vasko <mvasko@cesnet.cz> | Wed Dec 11 14:56:56 2019 +0100 |
committer | Michal Vasko <mvasko@cesnet.cz> | Wed Dec 11 14:56:56 2019 +0100 |
tree | 82b2991c1d788f46ba3250123c8b96d07fc8c9a3 | |
parent | 588112faff9021d2fb6f320c592694c4e6c385ab [diff] |
xpath BUGFIX adding node hash that is not yet in set
diff --git a/src/xpath.c b/src/xpath.c index f616c1c..e234385 100644 --- a/src/xpath.c +++ b/src/xpath.c
@@ -601,10 +601,15 @@ r = lyht_insert(set->ht, &hnode, hash, NULL); assert(!r); (void)r; - } - } else if (set->ht) { - assert(node); + if (hnode.node == node) { + /* it was just added, do not add it twice */ + node = NULL; + } + } + } + + if (set->ht && node) { /* add the new node into hash table */ hnode.node = node; hnode.type = type;