Unverified Commit 13c45a4a by Christian Brauner Committed by GitHub

Merge pull request #2673 from Blub/2018-10-06/cgfsng-alloc-cleanup

cgfsng: use realloc instead of malloc+copy+free
parents 0a886c56 5407d095
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment