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

guillem pushed a commit to branch master
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=098b9642ddae878c155c358e3ef5ca9ecf401d79

commit 098b9642ddae878c155c358e3ef5ca9ecf401d79 (HEAD -> master)
Author: Guillem Jover <[email protected]>
AuthorDate: Sat Jan 18 01:52:18 2020 +0100

    dpkg-split: Fix short-lived file descriptor leak --auto
    
    Warned-by: coverity
---
 debian/changelog   | 1 +
 dpkg-split/queue.c | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 8f7b431b5..6c695c356 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -118,6 +118,7 @@ dpkg (1.20.0) UNRELEASED; urgency=medium
     - libdpkg: Fix package format string to be a string literal.
       This suppresses a gcc warning.
     - dpkg: Fix short lived memory leak in --force-help handling.
+    - dpkg-split: Fix short lived file descriptor leak in --auto.
   * Build system:
     - Bump minimal Perl version to 5.24.1.
     - Add a serial versioning to the m4 files.
diff --git a/dpkg-split/queue.c b/dpkg-split/queue.c
index 6f9688035..145c9f503 100644
--- a/dpkg-split/queue.c
+++ b/dpkg-split/queue.c
@@ -152,13 +152,15 @@ do_auto(const char *const *argv)
   part = dpkg_ar_open(partfile);
   if (!part)
     ohshite(_("unable to read part file '%.250s'"), partfile);
-  if (!read_info(part, refi)) {
+  refi = read_info(part, refi);
+  dpkg_ar_close(part);
+
+  if (refi == NULL) {
     if (!opt_npquiet)
       printf(_("File '%.250s' is not part of a multipart archive.\n"), 
partfile);
     m_output(stdout, _("<standard output>"));
     return 1;
   }
-  dpkg_ar_close(part);
 
   queue = scandepot();
   partlist = nfmalloc(sizeof(*partlist) * refi->maxpartn);

-- 
Dpkg.Org's dpkg

Reply via email to