[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 07/12] storage_conf: Improve the memory deallocation of pool def parsing



On 05/22/2013 02:05 PM, Osier Yang wrote:
> Changes:
>     * Free all the strings at "cleanup", instead of freeing them
>       in the middle
>     * Remove xmlFree
>     * s/tmppath/target_path/, to make it more sensible
>     * Add new goto label "error"
> ---
>  src/conf/storage_conf.c | 54 ++++++++++++++++++++++++-------------------------
>  1 file changed, 26 insertions(+), 28 deletions(-)
> 
> diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
> index efe02e8..6f0ed74 100644
> --- a/src/conf/storage_conf.c
> +++ b/src/conf/storage_conf.c

> @@ -914,7 +910,7 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt)
>                  virReportError(VIR_ERR_XML_ERROR, "%s",
>                                 _("'wwnn' and 'wwpn' must be specified for adapter "
>                                   "type 'fchost'"));
> -                goto cleanup;
> +                goto error;
>              }
>  
>              if (!virValidateWWN(ret->source.adapter.data.fchost.wwnn) ||

If the WWN validation fails here, you still jump to cleanup instead of error.

ACK if you fix that.

Jan


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]