xpath BUGFIX null dereference
diff --git a/src/xpath.c b/src/xpath.c
index c4e5a6a..55cfa2b 100644
--- a/src/xpath.c
+++ b/src/xpath.c
@@ -783,7 +783,8 @@
         for (i = 0; i < set->used; ++i) {
             if ((set->val.scnodes[i].in_ctx == 1) || (set->val.scnodes[i].in_ctx == -2)) {
                 idx = lyxp_set_scnode_insert_node(ret, set->val.scnodes[i].scnode, set->val.scnodes[i].type);
-                if (idx == -1) {
+                /* coverity seems to think scnodes can be NULL */
+                if ((idx == -1) || !ret->val.scnodes) {
                     lyxp_set_free(ret);
                     return NULL;
                 }