|
|
26ba25 |
From bc451d7850fab973418fa083527b59f7d4fe1779 Mon Sep 17 00:00:00 2001
|
|
|
26ba25 |
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
|
|
|
26ba25 |
Date: Tue, 5 Feb 2019 11:25:51 +0000
|
|
|
26ba25 |
Subject: [PATCH 2/2] qga: fix 'driver' leak in guest-get-fsinfo
|
|
|
26ba25 |
MIME-Version: 1.0
|
|
|
26ba25 |
Content-Type: text/plain; charset=UTF-8
|
|
|
26ba25 |
Content-Transfer-Encoding: 8bit
|
|
|
26ba25 |
|
|
|
26ba25 |
RH-Author: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
26ba25 |
Message-id: <20190205112551.14763-3-marcandre.lureau@redhat.com>
|
|
|
26ba25 |
Patchwork-id: 84242
|
|
|
26ba25 |
O-Subject: [RHEL8/rhel qemu-kvm PATCH 2/2] qga: fix 'driver' leak in guest-get-fsinfo
|
|
|
26ba25 |
Bugzilla: 1666952
|
|
|
26ba25 |
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
26ba25 |
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
|
|
26ba25 |
RH-Acked-by: Danilo de Paula <ddepaula@redhat.com>
|
|
|
26ba25 |
|
|
|
26ba25 |
'driver' is leaked when the loop is not broken.
|
|
|
26ba25 |
|
|
|
26ba25 |
Leak introduced by commit 743c71d03c20d64f2bae5fba6f26cdf5e4b1bda6,
|
|
|
26ba25 |
spotted by ASAN.
|
|
|
26ba25 |
|
|
|
26ba25 |
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
26ba25 |
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
26ba25 |
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
|
|
|
26ba25 |
|
|
|
26ba25 |
(cherry picked from commit bb23a7362a7942739f080990a53e44afc319e36c)
|
|
|
26ba25 |
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
26ba25 |
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
|
|
|
26ba25 |
---
|
|
|
26ba25 |
qga/commands-posix.c | 1 +
|
|
|
26ba25 |
1 file changed, 1 insertion(+)
|
|
|
26ba25 |
|
|
|
26ba25 |
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
|
|
|
26ba25 |
index 71cb644..28b1c4c 100644
|
|
|
26ba25 |
--- a/qga/commands-posix.c
|
|
|
26ba25 |
+++ b/qga/commands-posix.c
|
|
|
26ba25 |
@@ -897,6 +897,7 @@ static void build_guest_fsinfo_for_real_device(char const *syspath,
|
|
|
26ba25 |
break;
|
|
|
26ba25 |
}
|
|
|
26ba25 |
|
|
|
26ba25 |
+ g_free(driver);
|
|
|
26ba25 |
if (sscanf(p, "/%x:%x:%x.%x%n",
|
|
|
26ba25 |
pci, pci + 1, pci + 2, pci + 3, &pcilen) == 4) {
|
|
|
26ba25 |
p += pcilen;
|
|
|
26ba25 |
--
|
|
|
26ba25 |
1.8.3.1
|
|
|
26ba25 |
|