The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/2673

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Signed-off-by: Wolfgang Bumiller <w.bumil...@errno.eu>
From 5407d095e6c66a5437234520db0252cd570c8d71 Mon Sep 17 00:00:00 2001
From: Wolfgang Bumiller <w.bumil...@errno.eu>
Date: Sat, 6 Oct 2018 11:12:08 +0200
Subject: [PATCH] cgfsng: use realloc instead of malloc+copy+free

Signed-off-by: Wolfgang Bumiller <w.bumil...@errno.eu>
---
 src/lxc/cgroups/cgfsng.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c
index 97913209c..71dfe72e6 100644
--- a/src/lxc/cgroups/cgfsng.c
+++ b/src/lxc/cgroups/cgfsng.c
@@ -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) {
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to