瀏覽代碼

dpkg: Fix varbuf memory leaks

In «dpkg --verify» and the dpkg infodb format upgrade logic.

Both are not big leaks, the first is bound by the amount of packages,
as the varbuf is reused for each file on each package, and the second
is just one instance of a leaked varbuf.

Stable-Candidate: 1.16.x 1.17.x
Guillem Jover 11 年之前
父節點
當前提交
af5a9c80d4
共有 3 個文件被更改,包括 4 次插入 和 0 次删除
  1. 1 0
      debian/changelog
  2. 1 0
      src/infodb-upgrade.c
  3. 2 0
      src/verify.c

+ 1 - 0
debian/changelog

@@ -8,6 +8,7 @@ dpkg (1.18.4) UNRELEASED; urgency=low
     state, otherwise we end up not passing the previously configured version
     to «postinst configure», which might consider this a first install instead
     of an upgrade. Closes: #801156
+  * Fix memory leaks in «dpkg --verify» and dpkg infodb format upgrade logic.
   * Build system:
     - Set PERL5LIB globally for the test suite to the local modules directory,
       to avoid using the system modules. Regression introduced in dpkg 1.17.8.

+ 1 - 0
src/infodb-upgrade.c

@@ -149,6 +149,7 @@ pkg_infodb_link_multiarch_files(void)
 	}
 	pop_cleanup(ehflag_normaltidy); /* closedir */
 
+	varbuf_destroy(&pkgname);
 	varbuf_destroy(&newname);
 	varbuf_destroy(&oldname);
 }

+ 2 - 0
src/verify.c

@@ -133,6 +133,8 @@ verify_package(struct pkginfo *pkg)
 		if (failures)
 			verify_output(fnn, &checks);
 	}
+
+	varbuf_destroy(&filename);
 }
 
 int