diff --git a/qga/commands-posix.c b/qga/commands-posix.c index 233f78a406..37e8a2d791 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; @@ -1651,6 +1652,7 @@ static bool linux_sys_state_supports_mode(SuspendMode mode, Error **errp) } ret = read(fd, buf, sizeof(buf) - 1); + close(fd); if (ret <= 0) { return false; }