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

dpkg: Fix memory leak in filesavespackage()

Free the filepackages_iterator also when returning false.
Guillem Jover лет назад: 14
Родитель
Сommit
6149f0f43e
2 измененных файлов с 2 добавлено и 0 удалено
  1. 1 0
      debian/changelog
  2. 1 0
      src/archives.c

+ 1 - 0
debian/changelog

@@ -19,6 +19,7 @@ dpkg (1.16.9) UNRELEASED; urgency=low
   * Do not leak subcall command arguments in update-alternatives.
   * Do not leak subcall command arguments in update-alternatives.
   * Fix segfault on update-alternatives when passing --slave without any
   * Fix segfault on update-alternatives when passing --slave without any
     action at all. LP: #1037431
     action at all. LP: #1037431
+  * Fix memory leak in dpkg filesavespackage().
 
 
   [ Updated programs translations ]
   [ Updated programs translations ]
   * Czech (Miroslav Kure).
   * Czech (Miroslav Kure).

+ 1 - 0
src/archives.c

@@ -170,6 +170,7 @@ filesavespackage(struct fileinlist *file,
 
 
     /* We've found a package that can take this file. */
     /* We've found a package that can take this file. */
     debug(dbg_eachfiledetail, "filesavespackage ...  taken -- no save");
     debug(dbg_eachfiledetail, "filesavespackage ...  taken -- no save");
+    filepackages_iter_free(iter);
     return false;
     return false;
   }
   }
   filepackages_iter_free(iter);
   filepackages_iter_free(iter);