aboutsummaryrefslogtreecommitdiff
path: root/qga
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2018-07-05 18:16:29 +0200
committerMichael Roth <mdroth@linux.vnet.ibm.com>2018-07-16 12:51:32 -0500
commitbb23a7362a7942739f080990a53e44afc319e36c (patch)
tree943154b0216709d5f67621d848767d6030f8c6e3 /qga
parent102ad0a80f5110483efd06877c29c4236be267f9 (diff)
qga: fix 'driver' leak in guest-get-fsinfo
'driver' is leaked when the loop is not broken. Leak introduced by commit 743c71d03c20d64f2bae5fba6f26cdf5e4b1bda6, spotted by ASAN. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'qga')
-rw-r--r--qga/commands-posix.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 233f78a406..c46767b0dd 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -890,6 +890,7 @@ static void build_guest_fsinfo_for_real_device(char const *syspath,
break;
}
+ g_free(driver);
if (sscanf(p, "/%x:%x:%x.%x%n",
pci, pci + 1, pci + 2, pci + 3, &pcilen) == 4) {
p += pcilen;