mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-08 22:15:21 +00:00
qemu_domain: Don't unref NULL hash table in qemuDomainRefreshStatsSchema()
The g_hash_table_unref() function does not accept NULL. Passing NULL results in a glib warning being triggered. Check whether the hash table is not NULL and unref it only then. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
95a278a845
commit
c3afde9211
@ -11923,7 +11923,8 @@ qemuDomainRefreshStatsSchema(virDomainObj *dom)
|
||||
if (!schema)
|
||||
return -1;
|
||||
|
||||
g_hash_table_unref(priv->statsSchema);
|
||||
if (priv->statsSchema)
|
||||
g_hash_table_unref(priv->statsSchema);
|
||||
priv->statsSchema = schema;
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user