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

dpkg-deb, libdpkg: Fix short-lived memory leaks

Closes: #769515
Guillem Jover лет назад: 11
Родитель
Сommit
2aeff6e069
4 измененных файлов с 9 добавлено и 0 удалено
  1. 1 0
      debian/changelog
  2. 2 0
      dpkg-deb/build.c
  3. 2 0
      dpkg-deb/info.c
  4. 4 0
      lib/dpkg/compress.c

+ 1 - 0
debian/changelog

@@ -67,6 +67,7 @@ dpkg (1.18.0) UNRELEASED; urgency=low
   * Trim end of line whitespace from dpkg and dselect config file parsers.
   * Trim end of line whitespace from dpkg and dselect config file parsers.
     Reported by Christoph Biedl <debian.axhn@manchmal.in-ulm.de>.
     Reported by Christoph Biedl <debian.axhn@manchmal.in-ulm.de>.
   * Do not silently eat a standalone ‘-’ in the libdpkg command-line parser.
   * Do not silently eat a standalone ‘-’ in the libdpkg command-line parser.
+  * Fix short-lived memory leaks in dpkg-deb and libdpkg. Closes: #769515
 
 
   [ Updated manpages translations ]
   [ Updated manpages translations ]
   * German (Helge Kreutzmann).
   * German (Helge Kreutzmann).

+ 2 - 0
dpkg-deb/build.c

@@ -621,5 +621,7 @@ do_build(const char *const *argv)
   if (close(arfd))
   if (close(arfd))
     ohshite(_("unable to close file '%s'"), debar);
     ohshite(_("unable to close file '%s'"), debar);
 
 
+  free(debar);
+
   return 0;
   return 0;
 }
 }

+ 2 - 0
dpkg-deb/info.c

@@ -66,6 +66,8 @@ static void cu_info_prepare(int argc, void **argv) {
     ohshite(_("unable to execute %s (%s)"), _("rm command for cleanup"), RM);
     ohshite(_("unable to execute %s (%s)"), _("rm command for cleanup"), RM);
   }
   }
   subproc_reap(pid, _("rm command for cleanup"), 0);
   subproc_reap(pid, _("rm command for cleanup"), 0);
+
+  free(dir);
 }
 }
 
 
 static void info_prepare(const char *const **argvp,
 static void info_prepare(const char *const **argvp,

+ 4 - 0
lib/dpkg/compress.c

@@ -829,6 +829,8 @@ decompress_filter(enum compressor_type type, int fd_in, int fd_out,
 	va_end(args);
 	va_end(args);
 
 
 	compressor(type)->decompress(fd_in, fd_out, desc.buf);
 	compressor(type)->decompress(fd_in, fd_out, desc.buf);
+
+	varbuf_destroy(&desc);
 }
 }
 
 
 void
 void
@@ -843,4 +845,6 @@ compress_filter(struct compress_params *params, int fd_in, int fd_out,
 	va_end(args);
 	va_end(args);
 
 
 	compressor(params->type)->compress(fd_in, fd_out, params, desc.buf);
 	compressor(params->type)->compress(fd_in, fd_out, params, desc.buf);
+
+	varbuf_destroy(&desc);
 }
 }