mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-09 04:20:05 +00:00
trivial: Fix a small memory leak when processing recommends
This commit is contained in:
parent
2bcb19ac4b
commit
30ee6064f9
@ -1709,7 +1709,8 @@ fu_engine_check_requirements(FuEngine *self,
|
|||||||
{
|
{
|
||||||
FuDevice *device = fu_install_task_get_device(task);
|
FuDevice *device = fu_install_task_get_device(task);
|
||||||
g_autoptr(GError) error_local = NULL;
|
g_autoptr(GError) error_local = NULL;
|
||||||
g_autoptr(GPtrArray) reqs = NULL;
|
g_autoptr(GPtrArray) reqs_hard = NULL;
|
||||||
|
g_autoptr(GPtrArray) reqs_soft = NULL;
|
||||||
|
|
||||||
/* all install task checks require a device */
|
/* all install task checks require a device */
|
||||||
if (device != NULL) {
|
if (device != NULL) {
|
||||||
@ -1718,10 +1719,11 @@ fu_engine_check_requirements(FuEngine *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* do engine checks */
|
/* do engine checks */
|
||||||
reqs = xb_node_query(fu_install_task_get_component(task), "requires/*", 0, &error_local);
|
reqs_hard =
|
||||||
if (reqs != NULL) {
|
xb_node_query(fu_install_task_get_component(task), "requires/*", 0, &error_local);
|
||||||
for (guint i = 0; i < reqs->len; i++) {
|
if (reqs_hard != NULL) {
|
||||||
XbNode *req = g_ptr_array_index(reqs, i);
|
for (guint i = 0; i < reqs_hard->len; i++) {
|
||||||
|
XbNode *req = g_ptr_array_index(reqs_hard, i);
|
||||||
if (!fu_engine_check_requirement(self, request, req, device, flags, error))
|
if (!fu_engine_check_requirement(self, request, req, device, flags, error))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -1733,13 +1735,13 @@ fu_engine_check_requirements(FuEngine *self,
|
|||||||
|
|
||||||
/* soft requirements */
|
/* soft requirements */
|
||||||
g_clear_error(&error_local);
|
g_clear_error(&error_local);
|
||||||
reqs = xb_node_query(fu_install_task_get_component(task),
|
reqs_soft = xb_node_query(fu_install_task_get_component(task),
|
||||||
"suggests/*|recommends/*",
|
"suggests/*|recommends/*",
|
||||||
0,
|
0,
|
||||||
&error_local);
|
&error_local);
|
||||||
if (reqs != NULL) {
|
if (reqs_soft != NULL) {
|
||||||
for (guint i = 0; i < reqs->len; i++) {
|
for (guint i = 0; i < reqs_soft->len; i++) {
|
||||||
XbNode *req = g_ptr_array_index(reqs, i);
|
XbNode *req = g_ptr_array_index(reqs_soft, i);
|
||||||
if (!fu_engine_check_soft_requirement(self,
|
if (!fu_engine_check_soft_requirement(self,
|
||||||
request,
|
request,
|
||||||
req,
|
req,
|
||||||
|
Loading…
Reference in New Issue
Block a user