From 6c93ac876f71d7221a172e430ca450b6c0b8b699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Wed, 20 Jul 2022 06:32:30 +0200 Subject: gregex: Free match info if offset matching recalc failed It's not probably ever happening in practice, but coverity found it and it's easy enough to fix it. Coverity CID: #1490730 --- glib/gregex.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'glib') diff --git a/glib/gregex.c b/glib/gregex.c index 5fc7b16bc..be03f0e09 100644 --- a/glib/gregex.c +++ b/glib/gregex.c @@ -2237,7 +2237,10 @@ g_regex_match_all_full (const GRegex *regex, info->workspace, info->n_workspace); if (!recalc_match_offsets (info, error)) - return FALSE; + { + g_match_info_free (info); + return FALSE; + } if (info->matches == PCRE2_ERROR_DFA_WSSIZE) { -- cgit v1.2.1