]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: rename virStorageEncryptionInfoDefFree()
authorLaine Stump <laine@redhat.com>
Fri, 29 Jan 2021 05:12:28 +0000 (00:12 -0500)
committerLaine Stump <laine@redhat.com>
Tue, 2 Feb 2021 05:27:58 +0000 (00:27 -0500)
usually a function call vir*Free() will take a single pointer to an
object as its argument, and will then free all resources associated
with that object, including the object
itself. virStorageEnctyptionInfoDefFree() doesn't do that - it frees
all the subordinate resources of the ojbect, but doesn't free the
object itself; usually a function like that is called
vir*Clear(). Let's rename this function to not be misleading.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/storage_encryption_conf.c

index 34ad5dffeb384f0ec30ca10b7ce0f2063b3f5065..6a32df15b78f899e7457fe58cd6a7e17d7180a41 100644 (file)
@@ -48,7 +48,7 @@ VIR_ENUM_IMPL(virStorageEncryptionFormat,
 );
 
 static void
-virStorageEncryptionInfoDefFree(virStorageEncryptionInfoDefPtr def)
+virStorageEncryptionInfoDefClear(virStorageEncryptionInfoDefPtr def)
 {
     VIR_FREE(def->cipher_name);
     VIR_FREE(def->cipher_mode);
@@ -77,7 +77,7 @@ virStorageEncryptionFree(virStorageEncryptionPtr enc)
 
     for (i = 0; i < enc->nsecrets; i++)
         virStorageEncryptionSecretFree(enc->secrets[i]);
-    virStorageEncryptionInfoDefFree(&enc->encinfo);
+    virStorageEncryptionInfoDefClear(&enc->encinfo);
     VIR_FREE(enc->secrets);
     VIR_FREE(enc);
 }