[Reproducible-commits] [dpkg] 09/33: dpkg: Fix a short-lived memory leak in archive argument parsing

Mattia Rizzolo mattia at debian.org
Mon Aug 1 10:25:26 UTC 2016


This is an automated email from the git hooks/post-receive script.

mattia pushed a commit to branch master
in repository dpkg.

commit 8d6ada9596f0dea58c9392d7327d1ba7aa507760
Author: Guillem Jover <guillem at debian.org>
Date:   Thu Jul 7 19:30:25 2016 +0200

    dpkg: Fix a short-lived memory leak in archive argument parsing
    
    Warned-by: coverity
---
 debian/changelog | 1 +
 src/archives.c   | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 6b9180c..b6a2d54 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
 dpkg (1.18.10) UNRELEASED; urgency=medium
 
   [ Guillem Jover ]
+  * Fix a short-lived memory leak in dpkg archive argument parsing.
   * Documentation:
     - Document Testsuite-Triggers in dsc(5).
     - Fix deb-changes(5) description to talk about .changes instead of .dsc.
diff --git a/src/archives.c b/src/archives.c
index fa64d0c..d07d4a4 100644
--- a/src/archives.c
+++ b/src/archives.c
@@ -1435,6 +1435,7 @@ int
 archivefiles(const char *const *argv)
 {
   const char *const *volatile argp;
+  const char **volatile arglist = NULL;
   int i;
   jmp_buf ejbuf;
   enum modstatdb_rw msdbflags;
@@ -1458,7 +1459,6 @@ archivefiles(const char *const *argv)
   log_message("startup archives %s", cipaction->olong);
 
   if (f_recursive) {
-    const char **arglist = NULL;
     const char *const *ap;
     int nfiles = 0;
 
@@ -1552,6 +1552,8 @@ archivefiles(const char *const *argv)
 
   dpkg_selabel_close();
 
+  free(arglist);
+
   switch (cipaction->arg_int) {
   case act_install:
   case act_configure:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list