[PATCH 24/39] virStorageBackendZFSRefreshPool: Reduce scope of 'tokens'

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

 



Declare it in the loop that actually uses it.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/storage/storage_backend_zfs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/storage/storage_backend_zfs.c b/src/storage/storage_backend_zfs.c
index cab1fd1637..6fed25cf4d 100644
--- a/src/storage/storage_backend_zfs.c
+++ b/src/storage/storage_backend_zfs.c
@@ -216,7 +216,6 @@ virStorageBackendZFSRefreshPool(virStoragePoolObjPtr pool G_GNUC_UNUSED)
     size_t i;
     g_autoptr(virCommand) cmd = NULL;
     g_auto(GStrv) lines = NULL;
-    g_auto(GStrv) tokens = NULL;
     g_autofree char *name = g_strdup(def->source.name);
     char *tmp;

@@ -246,13 +245,13 @@ virStorageBackendZFSRefreshPool(virStoragePoolObjPtr pool G_GNUC_UNUSED)
         goto cleanup;

     for (i = 0; lines[i]; i++) {
+        g_auto(GStrv) tokens = NULL;
         size_t count;
         char *prop_name;

         if (STREQ(lines[i], ""))
             continue;

-        g_strfreev(tokens);
         if (!(tokens = virStringSplitCount(lines[i], "\t", 0, &count)))
             goto cleanup;

-- 
2.29.2




[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]

  Powered by Linux