From: Christian Brauner Date: Thu, 18 Mar 2021 10:24:18 +0000 (+0100) Subject: apparmor: handle on-exec X-Git-Tag: lxc-5.0.0~197^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=389eb7c6da942847d16cb4d143b713ae110a596d;p=thirdparty%2Flxc.git apparmor: handle on-exec Signed-off-by: Christian Brauner --- diff --git a/src/lxc/lsm/apparmor.c b/src/lxc/lsm/apparmor.c index deadccc3e..73429ed33 100644 --- a/src/lxc/lsm/apparmor.c +++ b/src/lxc/lsm/apparmor.c @@ -1165,15 +1165,15 @@ static int apparmor_process_label_fd_get(struct lsm_ops *ops, pid_t pid, bool on static int apparmor_process_label_set_at(struct lsm_ops *ops, int label_fd, const char *label, bool on_exec) { + __do_free char *command = NULL; int ret = -1; size_t len; - __do_free char *command = NULL; if (on_exec) - log_trace(0, "Changing AppArmor profile on exec not supported"); + TRACE("Changing AppArmor profile on exec not supported"); len = strlen(label) + strlen("changeprofile ") + 1; - command = malloc(len); + command = zalloc(len); if (!command) return ret_errno(ENOMEM);