mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user