Explorar el Código

* apt-pkg/deb/dpkgpm.cc:
- fix resource leak (LP: #148806)

Michael Vogt hace 19 años
padre
commit
c771f6d9c3
Se han modificado 2 ficheros con 6 adiciones y 1 borrados
  1. 4 1
      apt-pkg/deb/dpkgpm.cc
  2. 2 0
      debian/changelog

+ 4 - 1
apt-pkg/deb/dpkgpm.cc

@@ -867,8 +867,11 @@ bool pkgDPkgPM::Go(int OutStatusFd)
       signal(SIGQUIT,old_SIGQUIT);
       signal(SIGQUIT,old_SIGQUIT);
       signal(SIGINT,old_SIGINT);
       signal(SIGINT,old_SIGINT);
 
 
-      if(master >= 0 && slave >= 0)
+      if(master >= 0) 
+      {
 	 tcsetattr(0, TCSAFLUSH, &tt);
 	 tcsetattr(0, TCSAFLUSH, &tt);
+	 close(master);
+      }
        
        
       // Check for an error code.
       // Check for an error code.
       if (WIFEXITED(Status) == 0 || WEXITSTATUS(Status) != 0)
       if (WIFEXITED(Status) == 0 || WEXITSTATUS(Status) != 0)

+ 2 - 0
debian/changelog

@@ -1,5 +1,7 @@
 apt (0.7.6ubuntu14) gutsy; urgency=low
 apt (0.7.6ubuntu14) gutsy; urgency=low
 
 
+  * apt-pkg/deb/dpkgpm.cc:
+    - fix resource leak (LP: #148806) 
   * debian/apt.cron.daily:
   * debian/apt.cron.daily:
     - only run the cron job if apt-get check succeeds (LP: #131719)
     - only run the cron job if apt-get check succeeds (LP: #131719)