Commit 5407d095 by Wolfgang Bumiller

cgfsng: use realloc instead of malloc+copy+free

parent 0a886c56
...@@ -1377,10 +1377,9 @@ __cgfsng_ops static inline bool cgfsng_monitor_create(struct cgroup_ops *ops, ...@@ -1377,10 +1377,9 @@ __cgfsng_ops static inline bool cgfsng_monitor_create(struct cgroup_ops *ops,
return bret; return bret;
len = strlen(tmp) + 5; /* leave room for -NNN\0 */ len = strlen(tmp) + 5; /* leave room for -NNN\0 */
monitor_cgroup = must_alloc(len); monitor_cgroup = must_realloc(tmp, len);
(void)strlcpy(monitor_cgroup, tmp, len);
free(tmp);
offset = monitor_cgroup + len - 5; offset = monitor_cgroup + len - 5;
*offset = 0;
do { do {
if (idx) { 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