[Pkg-libvirt-commits] [libguestfs] 13/26: lib: command: Fix leak in the per-child-process rlimit structures.

Hilko Bengen bengen at moszumanska.debian.org
Sun Nov 1 17:11:26 UTC 2015


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

bengen pushed a commit to annotated tag upstream/1.28.12
in repository libguestfs.

commit 01b82fa51f36f187d1129e45f1f099c6dfae0cbf
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Fri Jun 5 14:27:58 2015 +0100

    lib: command: Fix leak in the per-child-process rlimit structures.
    
    This fixes commit 9db0f807a917ec00d24297d5bf63c19065f930cf.
    
    Bug found by valgrind.
    
    (cherry picked from commit 47a15da2e7046e287de003715b858f47233885c1)
---
 src/command.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/command.c b/src/command.c
index 7d7842a..0a3eeca 100644
--- a/src/command.c
+++ b/src/command.c
@@ -679,6 +679,8 @@ guestfs___cmd_run (struct command *cmd)
 void
 guestfs___cmd_close (struct command *cmd)
 {
+  struct child_rlimits *child_rlimit, *child_rlimit_next;
+
   if (!cmd)
     return;
 
@@ -707,6 +709,12 @@ guestfs___cmd_close (struct command *cmd)
   if (cmd->pid > 0)
     waitpid (cmd->pid, NULL, 0);
 
+  for (child_rlimit = cmd->child_rlimits; child_rlimit != NULL;
+       child_rlimit = child_rlimit_next) {
+    child_rlimit_next = child_rlimit->next;
+    free (child_rlimit);
+  }
+
   free (cmd);
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list