- also free attrs array when freeing a solvable
authorMichael Schroeder <mls@suse.de>
Thu, 12 Apr 2012 13:09:14 +0000 (15:09 +0200)
committerMichael Schroeder <mls@suse.de>
Thu, 12 Apr 2012 13:09:14 +0000 (15:09 +0200)
src/repo.c

index 5a79e2d..b7372cf 100644 (file)
@@ -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));
+       }
+    }
 }