diff options
Diffstat (limited to 'lib/rpmal.c')
-rw-r--r-- | lib/rpmal.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/rpmal.c b/lib/rpmal.c index b6cdea3f6..149beb285 100644 --- a/lib/rpmal.c +++ b/lib/rpmal.c @@ -598,11 +598,13 @@ void rpmalMakeIndex(rpmal al) ai->index = xrealloc(ai->index, ai->size * sizeof(*ai->index)); ai->k = 0; - for (i = 0; i < al->size; i++) { alp = al->list + i; rpmalAddProvides(al, (alKey)i, alp->provides, alp->tscolor); } + + /* Reset size to the no. of provides added. */ + ai->size = ai->k; qsort(ai->index, ai->size, sizeof(*ai->index), indexcmp); } |