forked from ariadne/pkgconf
libpkgconf: pkg: some elements of virtual packages should be freed as they have heap-allocated portions (closes #132)
parent
9b55fc3c23
commit
f808300a01
|
@ -404,7 +404,10 @@ pkgconf_pkg_new_from_file(pkgconf_client_t *client, const char *filename, FILE *
|
||||||
void
|
void
|
||||||
pkgconf_pkg_free(pkgconf_client_t *client, pkgconf_pkg_t *pkg)
|
pkgconf_pkg_free(pkgconf_client_t *client, pkgconf_pkg_t *pkg)
|
||||||
{
|
{
|
||||||
if (pkg == NULL || pkg->flags & PKGCONF_PKG_PROPF_STATIC)
|
if (pkg == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (pkg->flags & PKGCONF_PKG_PROPF_STATIC && !(pkg->flags & PKGCONF_PKG_PROPF_VIRTUAL))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pkgconf_cache_remove(client, pkg);
|
pkgconf_cache_remove(client, pkg);
|
||||||
|
@ -421,6 +424,9 @@ pkgconf_pkg_free(pkgconf_client_t *client, pkgconf_pkg_t *pkg)
|
||||||
|
|
||||||
pkgconf_tuple_free(&pkg->vars);
|
pkgconf_tuple_free(&pkg->vars);
|
||||||
|
|
||||||
|
if (pkg->flags & PKGCONF_PKG_PROPF_VIRTUAL)
|
||||||
|
return;
|
||||||
|
|
||||||
if (pkg->id != NULL)
|
if (pkg->id != NULL)
|
||||||
free(pkg->id);
|
free(pkg->id);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue