mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-04-01 20:05:19 +00:00
util: vircgroup: use GLib alloc functions
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
parent
29c85e1664
commit
fed04cd635
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user