xpath BUGFIX proper set free
diff --git a/src/xpath.c b/src/xpath.c
index 8fe2d51..259fd9c 100644
--- a/src/xpath.c
+++ b/src/xpath.c
@@ -991,11 +991,7 @@
         return;
     }
 
-    if (trg->type == LYXP_SET_NODE_SET) {
-        free(trg->val.nodes);
-    } else if (trg->type == LYXP_SET_STRING) {
-        free(trg->val.str);
-    }
+    lyxp_set_free_content(trg);
     set_init(trg, src);
 
     if (src->type == LYXP_SET_SCNODE_SET) {