[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] qga-win: Free GMatchInfo properly
From: |
Kostiantyn Kostiuk |
Subject: |
[PATCH] qga-win: Free GMatchInfo properly |
Date: |
Thu, 10 Jun 2021 17:38:00 +0300 |
The g_regex_match function creates match_info even if it
returns FALSE. So we should always call g_match_info_free.
Signed-off-by: Kostiantyn Kostiuk <konstantin@daynix.com>
---
qga/commands-win32.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index 300b87c859..e8bc3df306 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -2497,6 +2497,7 @@ GuestDeviceInfoList *qmp_guest_get_devices(Error **errp)
GMatchInfo *match_info;
GuestDeviceIdPCI *id;
if (!g_regex_match(device_pci_re, hw_ids[j], 0, &match_info)) {
+ g_match_info_free(match_info);
continue;
}
skip = false;
--
2.25.1
- [PATCH] qga-win: Free GMatchInfo properly,
Kostiantyn Kostiuk <=