From: Eric Sunshine Date: Mon, 14 May 2018 03:05:54 GMT Subject: Re: [PATCH 2/1] config: let `config_store_data_clear()` handle `value_regex` Message-ID: In-Reply-To: <3f64a4e24a83a9041c79c8b302207af7687dbb21.1526204440.git.martin.agren@gmail.com> On Sun, May 13, 2018 at 5:58 AM, Martin Ågren wrote: > Instead of carefully clearing up `value_regex` in each code path, let > `config_store_data_clear()` handle that. > > Signed-off-by: Martin Ågren > --- > I *think* that it should be ok to `regfree()` after `regcomp()` failed, > but I'll need to look into that some more (and say something about it in > the commit message). My research (for instance [1,2]) seems to indicate that it would be better to avoid regfree() upon failed regcomp(), even though such a situation is handled sanely in some implementations. [1]: https://www.redhat.com/archives/libvir-list/2013-September/msg00276.html [2]: https://www.redhat.com/archives/libvir-list/2013-September/msg00273.html