Blame SOURCES/qemuga-qga-fix-driver-leak-in-guest-get-fsinfo.patch

12cf37
From 57d2a0742d2e37089a848e843203c7783ea9902e Mon Sep 17 00:00:00 2001
12cf37
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
12cf37
Date: Wed, 18 Jul 2018 12:56:42 +0200
12cf37
Subject: [PATCH 2/2] qga: fix 'driver' leak in guest-get-fsinfo
12cf37
MIME-Version: 1.0
12cf37
Content-Type: text/plain; charset=UTF-8
12cf37
Content-Transfer-Encoding: 8bit
12cf37
12cf37
RH-Author: Marc-André Lureau <marcandre.lureau@redhat.com>
12cf37
Message-id: <20180718125642.11815-3-marcandre.lureau@redhat.com>
12cf37
Patchwork-id: 81389
12cf37
O-Subject: [RHEL-7.6 qemu-guest-agent PATCH 2/2] qga: fix 'driver' leak in guest-get-fsinfo
12cf37
Bugzilla: 1567041
12cf37
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
12cf37
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
12cf37
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
12cf37
12cf37
'driver' is leaked when the loop is not broken.
12cf37
12cf37
Leak introduced by commit 743c71d03c20d64f2bae5fba6f26cdf5e4b1bda6,
12cf37
spotted by ASAN.
12cf37
12cf37
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
12cf37
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
12cf37
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
12cf37
12cf37
(cherry picked from commit bb23a7362a7942739f080990a53e44afc319e36c)
12cf37
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
12cf37
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
12cf37
---
12cf37
 qga/commands-posix.c | 1 +
12cf37
 1 file changed, 1 insertion(+)
12cf37
12cf37
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
12cf37
index 624b0dc..26c1863 100644
12cf37
--- a/qga/commands-posix.c
12cf37
+++ b/qga/commands-posix.c
12cf37
@@ -889,6 +889,7 @@ static void build_guest_fsinfo_for_real_device(char const *syspath,
12cf37
             break;
12cf37
         }
12cf37
 
12cf37
+        g_free(driver);
12cf37
         if (sscanf(p, "/%x:%x:%x.%x%n",
12cf37
                           pci, pci + 1, pci + 2, pci + 3, &pcilen) == 4) {
12cf37
             p += pcilen;
12cf37
-- 
12cf37
1.8.3.1
12cf37