vbox: Use g_autofree in tryLoadOne()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Michal Privoznik 2024-09-26 10:53:01 +02:00
parent 4118e79f3e
commit 10320ad526

View File

@ -78,7 +78,7 @@ tryLoadOne(const char *dir, bool setAppHome, bool ignoreMissing,
unsigned int *version)
{
int result = -1;
char *name = NULL;
g_autofree char *name = NULL;
PFNVBOXGETXPCOMCFUNCTIONS pfnGetFunctions;
if (dir != NULL) {
@ -88,7 +88,6 @@ tryLoadOne(const char *dir, bool setAppHome, bool ignoreMissing,
if (!ignoreMissing)
VIR_ERROR(_("Library '%1$s' doesn't exist"), name);
VIR_FREE(name);
return -1;
}
} else {
@ -152,8 +151,6 @@ tryLoadOne(const char *dir, bool setAppHome, bool ignoreMissing,
g_clear_pointer(&hVBoxXPCOMC, dlclose);
}
VIR_FREE(name);
return result;
}