]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
conf: avoid freeing network object with undestroyed mutex
authorLaine Stump <laine@laine.org>
Fri, 14 Sep 2012 08:53:54 +0000 (04:53 -0400)
committerLaine Stump <laine@laine.org>
Tue, 18 Sep 2012 00:24:06 +0000 (20:24 -0400)
commit16d9a3df94f21039a9f01d948ba327f36f3c63ab
treecf8dd164cd7caf0aaa80fd79f83b654d73ef3efc
parent764bd8537a5be821151b047d6e1c30f18c9f2936
conf: avoid freeing network object with undestroyed mutex

virNetworkAssignDef was allocating a new network object, initing and
grabbing its lock, then potentially freeing it without unlocking or
destroying the lock. In practice 1) this will probably never happen,
and 2) even if it did, the lock implementation used on most (all?)
platforms doesn't actually hold any resources for an initialized or
held lock, but it still bothered me, so I moved the realloc that could
lead to this bad situation earlier in the function, and now the mutex
isn't inited or locked until we are assured of complete success.
src/conf/network_conf.c