[libvirt] [v0.9.12-maint 08/11] Make sure regree is called close to it's usage

Eric Blake eblake at redhat.com
Wed Sep 11 20:46:08 UTC 2013


On 09/11/2013 08:00 AM, Luca Tettamanti wrote:
> This is a backport of 71da3b66a8455faf8019effe3cf504a31f91f54a.
> ---
>  src/storage/storage_backend_logical.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

This is not identical to the contents of 71da3b6 (it's missing the last
hunk, but then again, that was a revert of afc4631, so it works out in
the end).  I'm okay with having one patch instead of two, but it's
probably worth respinning this patch to use the usual cherry-pick
notation and preservation of the original commit contents; as well as
explicitly mentioning that the backport skips afc4631 and then its
reversion.

> 
> diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c
> index 9a91dd9..7abb17b 100644
> --- a/src/storage/storage_backend_logical.c
> +++ b/src/storage/storage_backend_logical.c
> @@ -204,13 +204,16 @@ virStorageBackendLogicalMakeVol(virStoragePoolObjPtr pool,
>      if (err != 0) {
>          char error[100];
>          regerror(err, reg, error, sizeof(error));
> +        regfree(reg);
>          virStorageReportError(VIR_ERR_INTERNAL_ERROR,
>                                _("Failed to compile regex %s"),
>                                error);
>          goto cleanup;
>      }
>  
> -    if (regexec(reg, groups[3], nvars, vars, 0) != 0) {
> +    err = regexec(reg, groups[3], nvars, vars, 0);
> +    regfree(reg);
> +    if (err != 0) {
>          virStorageReportError(VIR_ERR_INTERNAL_ERROR, "%s",
>                                _("malformed volume extent devices value"));
>          goto cleanup;
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130911/fa7788ee/attachment-0001.sig>


More information about the libvir-list mailing list