diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c index dfe98e7bfc..e8a0e3830b 100644 --- a/tools/xenstored/core.c +++ b/tools/xenstored/core.c @@ -1262,11 +1262,10 @@ const char *canonicalize(struct connection *conn, const void *ctx, * - illegal character in node * - starts with '@' but no special node allowed */ - errno = EINVAL; if (!node || !valid_chars(node) || (node[0] == '@' && !allow_special)) - return NULL; + goto inval; if (node[0] != '/' && node[0] != '@') { name = talloc_asprintf(ctx, "%s/%s", get_implicit_path(conn), @@ -1294,6 +1293,8 @@ const char *canonicalize(struct connection *conn, const void *ctx, if (name != node) talloc_free(name); + inval: + errno = EINVAL; return NULL; }