From 03b660c61572e7f98a3ec1cef4f48db0d615f6b0 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Tue, 2 Oct 2012 12:12:20 +0300 Subject: Only return non-NULL from rpmalAllSatisfiesDepends() on real matches - The provides hash lookup can and does return hits that dont actually satisfy the dependency. Dont bother callers with apparent hits (ie non-NULL returns) when nothing actually matches the dependency. --- lib/rpmal.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/rpmal.c b/lib/rpmal.c index fe0b36739..7496b44a0 100644 --- a/lib/rpmal.c +++ b/lib/rpmal.c @@ -402,7 +402,11 @@ rpmte * rpmalAllSatisfiesDepend(const rpmal al, const rpmds ds) found++; } } - ret[found] = NULL; + + if (found) + ret[found] = NULL; + else + ret = _free(ret); return ret; } -- cgit v1.2.3