]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
storage: Avoid double virCommandFree in virStorageBackendLogicalDeletePool
authorMartin Kletzander <mkletzan@redhat.com>
Thu, 28 Mar 2013 15:36:50 +0000 (16:36 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Fri, 29 Mar 2013 10:09:32 +0000 (11:09 +0100)
When logical pool has no PVs associated with itself (user-created),
virCommandFree(cmd) is called twice with the same pointer and that
causes a segfault in daemon.

src/storage/storage_backend_logical.c

index bce407f87074427113a41779547106fa12526292..4cf664775e1ccb8e66c2cf39a8a3613acccaaa44 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * storage_backend_logical.c: storage backend for logical volume handling
  *
- * Copyright (C) 2007-2009, 2011 Red Hat, Inc.
+ * Copyright (C) 2007-2009, 2011, 2013 Red Hat, Inc.
  * Copyright (C) 2007-2008 Daniel P. Berrange
  *
  * This library is free software; you can redistribute it and/or
@@ -667,6 +667,7 @@ virStorageBackendLogicalDeletePool(virConnectPtr conn ATTRIBUTE_UNUSED,
     if (virCommandRun(cmd, NULL) < 0)
         goto cleanup;
     virCommandFree(cmd);
+    cmd = NULL;
 
     /* now remove the pv devices and clear them out */
     ret = 0;