diff --git a/libpkgconf/dependency.c b/libpkgconf/dependency.c index 751a43a..f6414df 100644 --- a/libpkgconf/dependency.c +++ b/libpkgconf/dependency.c @@ -16,6 +16,8 @@ #include #include +#include + /* * !doc * @@ -244,8 +246,9 @@ pkgconf_dependency_unref(pkgconf_client_t *client, pkgconf_dependency_t *dep) return; dep->refcount--; + assert(dep->refcount >= 0); PKGCONF_TRACE(client, "%s: refcount@%p: %d", dep->package, dep, dep->refcount); - if (dep->refcount <= 0) + if (dep->refcount == 0) pkgconf_dependency_free_one(dep); }