]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
hyperv: Simplify hypervPrivate pointer handling in hypervOpen
authorMatthias Bolte <matthias.bolte@googlemail.com>
Thu, 10 Jan 2013 21:39:43 +0000 (22:39 +0100)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Sat, 2 Feb 2013 11:33:33 +0000 (12:33 +0100)
src/hyperv/hyperv_driver.c

index 601a85aaa467dd5bb1333049bddbf4b5f079f40c..4644bff65d4f6429b2b84bdb8cd7045b6d14cdcb 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * hyperv_driver.c: core driver functions for managing Microsoft Hyper-V hosts
  *
- * Copyright (C) 2011 Matthias Bolte <matthias.bolte@googlemail.com>
+ * Copyright (C) 2011-2013 Matthias Bolte <matthias.bolte@googlemail.com>
  * Copyright (C) 2009 Michael Sievers <msievers83@googlemail.com>
  *
  * 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);