nbdkit/0007-tests-Fix-memory-leak-in-OCaml-test-harness-found-by.patch

27 lines
666 B
Diff
Raw Normal View History

From 51551cfb115b2b7183d21fc0825f312434162323 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Sun, 10 Jul 2016 17:10:30 +0100
Subject: [PATCH 07/11] tests: Fix memory leak in OCaml test harness (found by
valgrind).
---
tests/test-ocaml.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/test-ocaml.c b/tests/test-ocaml.c
index 08b2e98..e77ff00 100644
--- a/tests/test-ocaml.c
+++ b/tests/test-ocaml.c
@@ -106,6 +106,8 @@ main (int argc, char *argv[])
exit (EXIT_FAILURE);
}
+ free (data);
+
data = guestfs_pread_device (g, "/dev/sda", 8 * 512, 0, &size);
if (!data)
exit (EXIT_FAILURE);
--
2.7.4