Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx> --- src/util/vircgroup.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index 5c0543c66a..d52c0305f4 100644 --- a/src/util/vircgroup.c +++ b/src/util/vircgroup.c @@ -785,10 +785,8 @@ virCgroupSetPartitionSuffix(const char *path, char **res) */ if (STRNEQ(tokens[i], "") && !strchr(tokens[i], '.')) { - if (VIR_REALLOC_N(tokens[i], - strlen(tokens[i]) + strlen(".partition") + 1) < 0) - goto cleanup; - strcat(tokens[i], ".partition"); + g_autofree char *oldtoken = tokens[i]; + tokens[i] = g_strdup_printf("%s.partition", oldtoken); } if (virCgroupPartitionEscape(&(tokens[i])) < 0) -- 2.26.2