Web lists-archives.com

Re: [PATCH 2/1] config: let `config_store_data_clear()` handle `value_regex`

On Sun, May 13, 2018 at 5:58 AM, Martin Ågren <martin.agren@xxxxxxxxx> wrote:
> Instead of carefully clearing up `value_regex` in each code path, let
> `config_store_data_clear()` handle that.
> Signed-off-by: Martin Ågren <martin.agren@xxxxxxxxx>
> ---
> 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