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

dpkg: Fix memory leak when unpacking conffiles

We keep a queue of conffile filenodenames, and never free it. We should
be using instead the obstack allocator, so that when we are done with
this package the list entries get all released at the same time.
Guillem Jover лет назад: 10
Родитель
Сommit
4b86f722f1
2 измененных файлов с 2 добавлено и 1 удалено
  1. 1 0
      debian/changelog
  2. 1 1
      src/archives.c

+ 1 - 0
debian/changelog

@@ -26,6 +26,7 @@ dpkg (1.18.5) UNRELEASED; urgency=medium
   * Add source format backend-specific --help options support to dpkg-source.
   * Add MIPS R6 architectures to arch tables. Closes: #807340
     Thanks to YunQiang Su <wzssyqa@gmail.com>.
+  * Fix memory leak when unpacking conffiles.
   * Portability:
     - Move DPKG_ADMINDIR environment variable name out from update-alternatives
       code, to make life easier for non-dpkg-based systems.

+ 1 - 1
src/archives.c

@@ -1655,7 +1655,7 @@ filenamenode_queue_push(struct filenamenode_queue *queue,
 {
   struct fileinlist *node;
 
-  node = m_malloc(sizeof(*node));
+  node = tar_pool_alloc(sizeof(*node));
   node->next = NULL;
   node->namenode = namenode;