diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index a0ee3f74afa9d8f09d7ebaa75a142be9be96c90a..ae718592863da3d59542038ea3fa5505ce55378c 100644 --- a/src/util/vircgroup.c +++ b/src/util/vircgroup.c @@ -1076,6 +1076,7 @@ int virCgroupMoveTask(virCgroupPtr src_group, virCgroupPtr dest_group) * aware that it needs to move. Therefore, we must iterate * until content is empty. */ while (1) { + VIR_FREE(content); rc = virCgroupGetValueStr(src_group, i, "tasks", &content); if (rc != 0) return rc; @@ -1085,8 +1086,6 @@ int virCgroupMoveTask(virCgroupPtr src_group, virCgroupPtr dest_group) rc = virCgroupAddTaskStrController(dest_group, content, i); if (rc != 0) goto cleanup; - - VIR_FREE(content); } }