瀏覽代碼

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 年之前
父節點
當前提交
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 source format backend-specific --help options support to dpkg-source.
   * Add MIPS R6 architectures to arch tables. Closes: #807340
   * Add MIPS R6 architectures to arch tables. Closes: #807340
     Thanks to YunQiang Su <wzssyqa@gmail.com>.
     Thanks to YunQiang Su <wzssyqa@gmail.com>.
+  * Fix memory leak when unpacking conffiles.
   * Portability:
   * Portability:
     - Move DPKG_ADMINDIR environment variable name out from update-alternatives
     - Move DPKG_ADMINDIR environment variable name out from update-alternatives
       code, to make life easier for non-dpkg-based systems.
       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;
   struct fileinlist *node;
 
 
-  node = m_malloc(sizeof(*node));
+  node = tar_pool_alloc(sizeof(*node));
   node->next = NULL;
   node->next = NULL;
   node->namenode = namenode;
   node->namenode = namenode;