All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] qga-win: Free GMatchInfo properly
@ 2021-06-10 14:38 Kostiantyn Kostiuk
  2021-06-10 14:41 ` Marc-André Lureau
  0 siblings, 1 reply; 5+ messages in thread
From: Kostiantyn Kostiuk @ 2021-06-10 14:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Roth

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



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-10 16:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-10 14:38 [PATCH] qga-win: Free GMatchInfo properly Kostiantyn Kostiuk
2021-06-10 14:41 ` Marc-André Lureau
2021-06-10 14:53   ` Konstantin Kostiuk
2021-06-10 15:23     ` Daniel P. Berrangé
2021-06-10 15:59       ` Konstantin Kostiuk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.