[PATCH 11/13] qemuDomainUnshareNamespace: Use automatic memory clearing for string lists

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

 



'devMountsPath' and 'devMountsSavePath' are NULL terminated.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_namespace.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_namespace.c b/src/qemu/qemu_namespace.c
index b2e6ecb71a..728d77fc61 100644
--- a/src/qemu/qemu_namespace.c
+++ b/src/qemu/qemu_namespace.c
@@ -682,7 +682,8 @@ qemuDomainUnshareNamespace(virQEMUDriverConfig *cfg,
                            virDomainObj *vm)
 {
     const char *devPath = NULL;
-    char **devMountsPath = NULL, **devMountsSavePath = NULL;
+    g_auto(GStrv) devMountsPath = NULL;
+    g_auto(GStrv) devMountsSavePath = NULL;
     size_t ndevMountsPath = 0, i;
     int ret = -1;

@@ -791,8 +792,6 @@ qemuDomainUnshareNamespace(virQEMUDriverConfig *cfg,
         else
             unlink(devMountsSavePath[i]);
     }
-    virStringListFreeCount(devMountsPath, ndevMountsPath);
-    virStringListFreeCount(devMountsSavePath, ndevMountsPath);
     return ret;
 }

-- 
2.31.1




[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