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

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