mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
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:
parent
4118e79f3e
commit
10320ad526
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user