mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-06 05:17:59 +00:00
Merge pull request #2673 from Blub/2018-10-06/cgfsng-alloc-cleanup
cgfsng: use realloc instead of malloc+copy+free
This commit is contained in:
commit
13c45a4a9d
@ -1377,10 +1377,9 @@ __cgfsng_ops static inline bool cgfsng_monitor_create(struct cgroup_ops *ops,
|
||||
return bret;
|
||||
|
||||
len = strlen(tmp) + 5; /* leave room for -NNN\0 */
|
||||
monitor_cgroup = must_alloc(len);
|
||||
(void)strlcpy(monitor_cgroup, tmp, len);
|
||||
free(tmp);
|
||||
monitor_cgroup = must_realloc(tmp, len);
|
||||
offset = monitor_cgroup + len - 5;
|
||||
*offset = 0;
|
||||
|
||||
do {
|
||||
if (idx) {
|
||||
|
Loading…
Reference in New Issue
Block a user