1From 6c93ac876f71d7221a172e430ca450b6c0b8b699 Mon Sep 17 00:00:00 2001 2From: Marco Trevisan <mail@3v1n0.net> 3Date: Wed, 20 Jul 2022 06:32:30 +0200 4Subject: [PATCH] gregex: Free match info if offset matching recalc failed 5 6It's not probably ever happening in practice, but coverity found it and 7it's easy enough to fix it. 8 9Coverity CID: #1490730 10 11Conflict:NA 12Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/6c93ac876f71d7221a172e430ca450b6c0b8b699 13 14--- 15 glib/gregex.c | 5 ++++- 16 1 file changed, 4 insertions(+), 1 deletion(-) 17 18diff --git a/glib/gregex.c b/glib/gregex.c 19index 5fc7b16bc8..be03f0e094 100644 20--- a/glib/gregex.c 21+++ b/glib/gregex.c 22@@ -2237,7 +2237,10 @@ g_regex_match_all_full (const GRegex *regex, 23 info->workspace, info->n_workspace); 24 25 if (!recalc_match_offsets (info, error)) 26- return FALSE; 27+ { 28+ g_match_info_free (info); 29+ return FALSE; 30+ } 31 32 if (info->matches == PCRE2_ERROR_DFA_WSSIZE) 33 { 34-- 35GitLab 36 37