diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index 601a85aaa467dd5bb1333049bddbf4b5f079f40c..4644bff65d4f6429b2b84bdb8cd7045b6d14cdcb 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -2,7 +2,7 @@ /* * hyperv_driver.c: core driver functions for managing Microsoft Hyper-V hosts * - * Copyright (C) 2011 Matthias Bolte + * Copyright (C) 2011-2013 Matthias Bolte * Copyright (C) 2009 Michael Sievers * * This library is free software; you can redistribute it and/or @@ -200,14 +200,11 @@ hypervOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int flags) } conn->privateData = priv; - + priv = NULL; result = VIR_DRV_OPEN_SUCCESS; cleanup: - if (result == VIR_DRV_OPEN_ERROR) { - hypervFreePrivate(&priv); - } - + hypervFreePrivate(&priv); VIR_FREE(username); VIR_FREE(password); hypervFreeObject(priv, (hypervObject *)computerSystem);