queue: ensure cleanup happens when applying
parent
4a1119aa2a
commit
e275594ba6
|
@ -261,6 +261,7 @@ pkgconf_queue_verify(pkgconf_client_t *client, pkgconf_pkg_t *world, pkgconf_lis
|
||||||
bool
|
bool
|
||||||
pkgconf_queue_apply(pkgconf_client_t *client, pkgconf_list_t *list, pkgconf_queue_apply_func_t func, int maxdepth, void *data)
|
pkgconf_queue_apply(pkgconf_client_t *client, pkgconf_list_t *list, pkgconf_queue_apply_func_t func, int maxdepth, void *data)
|
||||||
{
|
{
|
||||||
|
bool ret = false;
|
||||||
pkgconf_pkg_t world = {
|
pkgconf_pkg_t world = {
|
||||||
.id = "virtual:world",
|
.id = "virtual:world",
|
||||||
.realname = "virtual world package",
|
.realname = "virtual world package",
|
||||||
|
@ -272,18 +273,17 @@ pkgconf_queue_apply(pkgconf_client_t *client, pkgconf_list_t *list, pkgconf_queu
|
||||||
maxdepth = -1;
|
maxdepth = -1;
|
||||||
|
|
||||||
if (pkgconf_queue_verify(client, &world, list, maxdepth) != PKGCONF_PKG_ERRF_OK)
|
if (pkgconf_queue_verify(client, &world, list, maxdepth) != PKGCONF_PKG_ERRF_OK)
|
||||||
return false;
|
goto cleanup;
|
||||||
|
|
||||||
/* the world dependency set is flattened after it is returned from pkgconf_queue_verify */
|
/* the world dependency set is flattened after it is returned from pkgconf_queue_verify */
|
||||||
if (!func(client, &world, data, maxdepth))
|
if (!func(client, &world, data, maxdepth))
|
||||||
{
|
goto cleanup;
|
||||||
pkgconf_pkg_free(client, &world);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
ret = true;
|
||||||
|
|
||||||
|
cleanup:
|
||||||
pkgconf_pkg_free(client, &world);
|
pkgconf_pkg_free(client, &world);
|
||||||
|
return ret;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue