]> xenbits.xensource.com Git - libvirt.git/commitdiff
virTPMEmulatorInit: Don't use temporary variable to free path
authorPeter Krempa <pkrempa@redhat.com>
Thu, 11 Jun 2020 08:26:19 +0000 (10:26 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 15 Jun 2020 08:27:37 +0000 (10:27 +0200)
Use VIR_FREE directly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com
src/util/virtpm.c

index c734bf941a25ad0355f9a610b82676582096d28a..71c1a2ecb34527b3a9db44be415d649ff9ea341a 100644 (file)
@@ -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) {