xpath BUGFIX message safe print
diff --git a/src/xpath.c b/src/xpath.c
index 66a9dbf..b936392 100644
--- a/src/xpath.c
+++ b/src/xpath.c
@@ -4025,7 +4025,7 @@
                 /* find leafref target */
                 if (lyplg_type_resolve_leafref((struct lysc_type_leafref *)sleaf->type, &leaf->node, &leaf->value, set->tree,
                         &node, &errmsg)) {
-                    LOGERR(set->ctx, LY_EVALID, errmsg);
+                    LOGERR(set->ctx, LY_EVALID, "%s", errmsg);
                     free(errmsg);
                     return LY_EVALID;
                 }