lib: Prefer g_autoptr() declaration of virQEMUDriverConfigPtr

In the past we had to declare @cfg and then explicitly unref it.
But now, with glib we can use g_autoptr() which will do the unref
automatically and thus is more bulletproof.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
Michal Privoznik
2020-09-04 08:59:08 +02:00
parent 5befe4ee18
commit d92c2bbc65
7 changed files with 10 additions and 27 deletions

View File

@@ -132,7 +132,7 @@ mymain(void)
{
int ret = 0;
g_autofree char *fakerootdir = NULL;
virQEMUDriverConfigPtr cfg = NULL;
g_autoptr(virQEMUDriverConfig) cfg = NULL;
g_autoptr(virHashTable) capslatest = NULL;
g_autoptr(virConnect) conn = NULL;