datatypes: Get virSecretFreeName in sync with the other free functions

This commit is contained in:
Matthias Bolte 2011-01-15 14:54:19 +01:00
parent a50a22df45
commit 6916cfd7dd

View File

@ -113,19 +113,16 @@ virStorageVolFreeName(virStorageVolPtr vol, const char *name ATTRIBUTE_UNUSED)
/** /**
* virSecretFreeName: * virSecretFreeName:
* @secret_: a secret object * @secret: a secret object
* *
* Destroy the secret object, this is just used by the secret hash callback. * Destroy the secret object, this is just used by the secret hash callback.
* *
* Returns 0 in case of success and -1 in case of failure. * Returns 0 in case of success and -1 in case of failure.
*/ */
static void static int
virSecretFreeName(void *secret_, const char *name ATTRIBUTE_UNUSED) virSecretFreeName(virSecretPtr secret, const char *name ATTRIBUTE_UNUSED)
{ {
virSecretPtr secret; return virUnrefSecret(secret);
secret = secret_;
virUnrefSecret(secret);
} }
/** /**
@ -225,7 +222,7 @@ failed:
if (ret->nodeDevices != NULL) if (ret->nodeDevices != NULL)
virHashFree(ret->nodeDevices, (virHashDeallocator) virNodeDeviceFree); virHashFree(ret->nodeDevices, (virHashDeallocator) virNodeDeviceFree);
if (ret->secrets != NULL) if (ret->secrets != NULL)
virHashFree(ret->secrets, virSecretFreeName); virHashFree(ret->secrets, (virHashDeallocator) virSecretFreeName);
if (ret->nwfilterPools != NULL) if (ret->nwfilterPools != NULL)
virHashFree(ret->nwfilterPools, (virHashDeallocator) virNWFilterPoolFreeName); virHashFree(ret->nwfilterPools, (virHashDeallocator) virNWFilterPoolFreeName);
@ -283,7 +280,7 @@ virReleaseConnect(virConnectPtr conn) {
if (conn->nodeDevices != NULL) if (conn->nodeDevices != NULL)
virHashFree(conn->nodeDevices, (virHashDeallocator) virNodeDeviceFree); virHashFree(conn->nodeDevices, (virHashDeallocator) virNodeDeviceFree);
if (conn->secrets != NULL) if (conn->secrets != NULL)
virHashFree(conn->secrets, virSecretFreeName); virHashFree(conn->secrets, (virHashDeallocator) virSecretFreeName);
if (conn->nwfilterPools != NULL) if (conn->nwfilterPools != NULL)
virHashFree(conn->nwfilterPools, (virHashDeallocator) virNWFilterPoolFreeName); virHashFree(conn->nwfilterPools, (virHashDeallocator) virNWFilterPoolFreeName);