From 3bd3e6a00b6f9d48082298b1ae03a76c59a9cdc1 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Thu, 12 Apr 2012 15:09:14 +0200 Subject: [PATCH] - also free attrs array when freeing a solvable --- src/repo.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/repo.c b/src/repo.c index 5a79e2d..b7372cf 100644 --- a/src/repo.c +++ b/src/repo.c @@ -198,8 +198,24 @@ repo_free_solvable_block(Repo *repo, Id start, int count, int reuseids) s->repo = 0; pool_free_solvable_block(repo->pool, start, count, reuseids); FOR_REPODATAS(repo, i, data) - if (data->end > repo->end) - repodata_shrink(data, repo->end); + { + int dstart, dend; + if (data->end > repo->end) + repodata_shrink(data, repo->end); + dstart = data->start > start ? data->start : start; + dend = data->end < start + count ? data->end : start + count; + if (dstart < dend) + { + if (data->attrs) + { + int j; + for (j = dstart; j < dend; j++) + data->attrs[j - data->start] = solv_free(data->attrs[j - data->start]); + } + if (data->incoreoffset) + memset(data->incoreoffset + (dstart - data->start), 0, (dend - dstart) * sizeof(Id)); + } + } } -- 2.7.4