]> xenbits.xensource.com Git - libvirt.git/commitdiff
vircgroup: move parentPath declaration
authorPavel Hrdina <phrdina@redhat.com>
Mon, 2 Nov 2020 21:11:36 +0000 (22:11 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Tue, 3 Nov 2020 20:26:32 +0000 (21:26 +0100)
It's used only inside the if condition.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/util/vircgroup.c

index f4c162356785bd41955837c2c76f54fdf4c2fc71..6caeb2d7f47462db2cb1759a3a9b15ebd17fc5af 100644 (file)
@@ -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++;