[PATCH 04/14] secret: Remove local virSecretPtr 'secret'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Remove the need for the local 'secret' in secretConnectListAllSecrets.
A subsequent patch will rename the ObjPtr entry to secret.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/secret/secret_driver.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c
index 27c3f9e..07b3257 100644
--- a/src/secret/secret_driver.c
+++ b/src/secret/secret_driver.c
@@ -576,7 +576,6 @@ secretConnectListAllSecrets(virConnectPtr conn,
     virSecretPtr *tmp_secrets = NULL;
     int nsecrets = 0;
     int ret_nsecrets = 0;
-    virSecretPtr secret = NULL;
     virSecretObjPtr entry = NULL;
     size_t i = 0;
     int ret = -1;
@@ -616,12 +615,12 @@ secretConnectListAllSecrets(virConnectPtr conn,
             continue;
 
         if (secrets) {
-            if (!(secret = virGetSecret(conn,
-                                        entry->def->uuid,
-                                        entry->def->usage_type,
-                                        secretUsageIDForDef(entry->def))))
+            if (!(tmp_secrets[ret_nsecrets] =
+                  virGetSecret(conn,
+                               entry->def->uuid,
+                               entry->def->usage_type,
+                               secretUsageIDForDef(entry->def))))
                 goto cleanup;
-            tmp_secrets[ret_nsecrets] = secret;
         }
         ret_nsecrets++;
     }
-- 
2.5.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]