X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=qom%2Fobject.c;fp=qom%2Fobject.c;h=dd53d242a5cffe6810cf6b315ee5f6efa56d3316;hb=2e1103f60a871923ecd390804aba07b6031e0dc0;hp=093502e5099315ddcfd431ae94779cb896301461;hpb=98af93fde2e37b5b0c8cee9036e028fe6df6446c;p=qemu.git diff --git a/qom/object.c b/qom/object.c index 093502e50..dd53d242a 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1113,21 +1113,13 @@ static Object *object_resolve_partial_path(Object *parent, Object *object_resolve_path_type(const char *path, const char *typename, bool *ambiguous) { - bool partial_path = true; Object *obj; gchar **parts; parts = g_strsplit(path, "/", 0); - if (parts == NULL || parts[0] == NULL) { - g_strfreev(parts); - return object_get_root(); - } - - if (strcmp(parts[0], "") == 0) { - partial_path = false; - } + assert(parts); - if (partial_path) { + if (parts[0] == NULL || strcmp(parts[0], "") != 0) { if (ambiguous) { *ambiguous = false; }