dependency: unref dependency parent if it's set

libpkgconf never sets this internally, but it is in the API and someone
could set it (or libpkgconf could in the future), so let's clean up
after ourselves.
Dylan Baker 2022-07-28 09:54:25 -07:00
parent 75a5fe0757
commit 7b3346206e
1 changed files with 3 additions and 0 deletions

View File

@ -197,6 +197,9 @@ pkgconf_dependency_free_one(pkgconf_dependency_t *dep)
if (dep->match != NULL)
pkgconf_pkg_unref(dep->match->owner, dep->match);
if (dep->parent != NULL)
pkgconf_pkg_unref(dep->match->owner, dep->parent);
if (dep->package != NULL)
free(dep->package);