diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2018-04-30 11:44:17 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2018-05-09 00:13:37 +0200 |
commit | 770dec2627b085457280490ac0543def97396fef (patch) | |
tree | 30d62cd3ed9b39f9ad07a5d650475a66f041bb8d /qom/object.c | |
parent | 82870f3c0295d36c342942b4757b2b1ddd55ab19 (diff) | |
download | qemu-770dec2627b085457280490ac0543def97396fef.zip qemu-770dec2627b085457280490ac0543def97396fef.tar.gz qemu-770dec2627b085457280490ac0543def97396fef.tar.bz2 |
qom: allow object_get_canonical_path_component without parent
Just return NULL; any callers that cause a change in behavior
would have caused an assertion failure before, so this is safe.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'qom/object.c')
-rw-r--r-- | qom/object.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/qom/object.c b/qom/object.c index 76a89af..0fc9720 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1644,8 +1644,9 @@ gchar *object_get_canonical_path_component(Object *obj) ObjectProperty *prop = NULL; GHashTableIter iter; - g_assert(obj); - g_assert(obj->parent != NULL); + if (obj->parent == NULL) { + return NULL; + } g_hash_table_iter_init(&iter, obj->parent->properties); while (g_hash_table_iter_next(&iter, NULL, (gpointer *)&prop)) { |