[libvirt PATCH 23/25] vircgroup: move parentPath declaration

Pavel Hrdina phrdina at redhat.com
Tue Nov 3 12:41:35 UTC 2020


It's used only inside the if condition.

Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
 src/util/vircgroup.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index f4c1623567..6caeb2d7f4 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -893,7 +893,6 @@ virCgroupNewPartition(const char *path,
                       int controllers,
                       virCgroupPtr *group)
 {
-    g_autofree char *parentPath = NULL;
     g_autofree char *newPath = NULL;
     g_autoptr(virCgroup) parent = NULL;
     g_autoptr(virCgroup) newGroup = NULL;
@@ -915,7 +914,7 @@ virCgroupNewPartition(const char *path,
 
     if (STRNEQ(newPath, "/")) {
         char *tmp;
-        parentPath = g_strdup(newPath);
+        g_autofree char *parentPath = g_strdup(newPath);
 
         tmp = strrchr(parentPath, '/');
         tmp++;
-- 
2.26.2




More information about the libvir-list mailing list