summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-10-02 12:12:20 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-10-02 12:15:49 +0300
commit03b660c61572e7f98a3ec1cef4f48db0d615f6b0 (patch)
tree3dad473e02f492cb0bb842e000ce646aa25b65d9 /lib
parentb900c06b9961c5b50b3fc12b9de79507294fa1c5 (diff)
downloadlibrpm-tizen-03b660c61572e7f98a3ec1cef4f48db0d615f6b0.tar.gz
librpm-tizen-03b660c61572e7f98a3ec1cef4f48db0d615f6b0.tar.bz2
librpm-tizen-03b660c61572e7f98a3ec1cef4f48db0d615f6b0.zip
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/rpmal.c6
1 files changed, 5 insertions, 1 deletions
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;
}