mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-09 15:23:48 +00:00
trivial: Always call va_end() even in the error path
This commit is contained in:
parent
03d166158d
commit
0d7d8b3240
@ -4977,6 +4977,7 @@ fu_device_build_instance_id(FuDevice *self, GError **error, const gchar *subsyst
|
|||||||
{
|
{
|
||||||
FuDevice *parent = fu_device_get_parent(self);
|
FuDevice *parent = fu_device_get_parent(self);
|
||||||
FuDevicePrivate *priv = GET_PRIVATE(self);
|
FuDevicePrivate *priv = GET_PRIVATE(self);
|
||||||
|
gboolean ret = TRUE;
|
||||||
va_list args;
|
va_list args;
|
||||||
g_autoptr(GString) str = g_string_new(subsystem);
|
g_autoptr(GString) str = g_string_new(subsystem);
|
||||||
|
|
||||||
@ -5001,13 +5002,18 @@ fu_device_build_instance_id(FuDevice *self, GError **error, const gchar *subsyst
|
|||||||
G_IO_ERROR_INVALID_DATA,
|
G_IO_ERROR_INVALID_DATA,
|
||||||
"no value for %s",
|
"no value for %s",
|
||||||
key);
|
key);
|
||||||
return FALSE;
|
ret = FALSE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
g_string_append(str, i == 0 ? "\\" : "&");
|
g_string_append(str, i == 0 ? "\\" : "&");
|
||||||
g_string_append_printf(str, "%s_%s", key, value);
|
g_string_append_printf(str, "%s_%s", key, value);
|
||||||
}
|
}
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
|
/* we set an error above */
|
||||||
|
if (!ret)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
/* success */
|
/* success */
|
||||||
fu_device_add_instance_id(self, str->str);
|
fu_device_add_instance_id(self, str->str);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -5031,6 +5037,7 @@ gboolean
|
|||||||
fu_device_build_instance_id_quirk(FuDevice *self, GError **error, const gchar *subsystem, ...)
|
fu_device_build_instance_id_quirk(FuDevice *self, GError **error, const gchar *subsystem, ...)
|
||||||
{
|
{
|
||||||
FuDevicePrivate *priv = GET_PRIVATE(self);
|
FuDevicePrivate *priv = GET_PRIVATE(self);
|
||||||
|
gboolean ret = TRUE;
|
||||||
va_list args;
|
va_list args;
|
||||||
g_autoptr(GString) str = g_string_new(subsystem);
|
g_autoptr(GString) str = g_string_new(subsystem);
|
||||||
|
|
||||||
@ -5051,13 +5058,18 @@ fu_device_build_instance_id_quirk(FuDevice *self, GError **error, const gchar *s
|
|||||||
G_IO_ERROR_INVALID_DATA,
|
G_IO_ERROR_INVALID_DATA,
|
||||||
"no value for %s",
|
"no value for %s",
|
||||||
key);
|
key);
|
||||||
return FALSE;
|
ret = FALSE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
g_string_append(str, i == 0 ? "\\" : "&");
|
g_string_append(str, i == 0 ? "\\" : "&");
|
||||||
g_string_append_printf(str, "%s_%s", key, value);
|
g_string_append_printf(str, "%s_%s", key, value);
|
||||||
}
|
}
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
|
/* we set an error above */
|
||||||
|
if (!ret)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
/* success */
|
/* success */
|
||||||
fu_device_add_instance_id_full(self, str->str, FU_DEVICE_INSTANCE_FLAG_ONLY_QUIRKS);
|
fu_device_add_instance_id_full(self, str->str, FU_DEVICE_INSTANCE_FLAG_ONLY_QUIRKS);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
Loading…
Reference in New Issue
Block a user