[Pkg-libvirt-commits] [libguestfs] 26/31: lib: command: Fix leak in the per-child-process rlimit structures.
Hilko Bengen
bengen at moszumanska.debian.org
Sun Nov 1 17:13:10 UTC 2015
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to annotated tag upstream/1.29.46
in repository libguestfs.
commit 47a15da2e7046e287de003715b858f47233885c1
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.
---
src/command.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/command.c b/src/command.c
index 993198a..5b45e62 100644
--- a/src/command.c
+++ b/src/command.c
@@ -778,6 +778,8 @@ guestfs_int_cmd_wait (struct command *cmd)
void
guestfs_int_cmd_close (struct command *cmd)
{
+ struct child_rlimits *child_rlimit, *child_rlimit_next;
+
if (!cmd)
return;
@@ -809,6 +811,12 @@ guestfs_int_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