Re: [PATCH 06/20] test: testOpenDefault: introduce cleanup path

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

 




On 03/08/2018 07:20 AM, Marc Hartmayer wrote:
> The two code paths have some cleanup in common so lets refactor it.
> 
> Signed-off-by: Marc Hartmayer <mhartmay@xxxxxxxxxxxxxxxxxx>
> Reviewed-by: Boris Fiuczynski <fiuczy@xxxxxxxxxxxxxxxxxx>
> ---
>  src/test/test_driver.c | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/src/test/test_driver.c b/src/test/test_driver.c
> index 2773f5c758c8..e7307fddad4a 100644
> --- a/src/test/test_driver.c
> +++ b/src/test/test_driver.c
> @@ -1306,6 +1306,7 @@ testOpenFromFile(virConnectPtr conn, const char *file)
>  static int
>  testOpenDefault(virConnectPtr conn)
>  {
> +    int ret;

So that no one ever adds a goto cleanup some day and @ret isn't set,
let's initialize to VIR_DRV_OPEN_ERROR (and remove that setting in the
error: label).

Reviewed-by: John Ferlan <jferlan@xxxxxxxxxx>

John

[I'll continue with the rest tomorrow]

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux