[PATCH 4/7] virTPMEmulatorInit: Don't use temporary variable to free path

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

 



Use VIR_FREE directly.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/util/virtpm.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/util/virtpm.c b/src/util/virtpm.c
index c734bf941a..71c1a2ecb3 100644
--- a/src/util/virtpm.c
+++ b/src/util/virtpm.c
@@ -290,7 +290,6 @@ virTPMEmulatorInit(void)
         g_autofree char *path = NULL;
         bool findit = *prgs[i].path == NULL;
         struct stat statbuf;
-        char *tmp;

         if (!findit) {
             /* has executables changed? */
@@ -303,9 +302,7 @@ virTPMEmulatorInit(void)
         }

         if (findit) {
-            tmp = *prgs[i].path;
-            VIR_FREE(tmp);
-            *prgs[i].path = NULL;
+            VIR_FREE(*prgs[i].path);

             path = virFindFileInPath(prgs[i].name);
             if (!path) {
-- 
2.26.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