Просмотр исходного кода

Release the package iterators when done

This is a cause of memory leaks, but in these cases the program is about
to exit anyway, so we do it for correctness.
Guillem Jover лет назад: 16
Родитель
Сommit
1d647dd23c
2 измененных файлов с 4 добавлено и 0 удалено
  1. 2 0
      dselect/pkglist.cc
  2. 2 0
      src/enquiry.c

+ 2 - 0
dselect/pkglist.cc

@@ -417,6 +417,8 @@ packagelist::packagelist(keybindings *kb) : baselist(kb) {
     table[nitems]= state;
     nitems++;
   }
+  iterpkgend(iter);
+
   if (!nitems)
     ohshit(_("There are no packages."));
   recursive= 0;

+ 2 - 0
src/enquiry.c

@@ -347,6 +347,8 @@ void predeppackage(const char *const *argv) {
     pkg->clientdata->istobe= itb_normal;
     /* If dep is NULL we go and get the next package. */
   }
+  iterpkgend(it);
+
   if (!dep) exit(1); /* Not found */
   assert(pkg);
   startpkg= pkg;