From: Lennart Poettering Date: Tue, 23 Jan 2018 18:36:36 +0000 (+0100) Subject: namespace: use stack allocation for paths, where we can X-Git-Tag: v237~43^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f7f3a33514a2ce9bfeba5b58a22ac74a5d8b52d;p=thirdparty%2Fsystemd.git namespace: use stack allocation for paths, where we can --- diff --git a/src/core/namespace.c b/src/core/namespace.c index e030a575973..7b9ef85ff84 100644 --- a/src/core/namespace.c +++ b/src/core/namespace.c @@ -497,7 +497,7 @@ static void drop_outside_root(const char *root_directory, MountEntry *m, unsigne } static int clone_device_node(const char *d, const char *temporary_mount) { - _cleanup_free_ char *dn = NULL; + const char *dn; struct stat st; int r; @@ -514,14 +514,11 @@ static int clone_device_node(const char *d, const char *temporary_mount) { if (st.st_rdev == 0) return 0; - dn = strappend(temporary_mount, d); - if (!dn) - return -ENOMEM; + dn = strjoina(temporary_mount, d); mac_selinux_create_file_prepare(d, st.st_mode); r = mknod(dn, st.st_mode, st.st_rdev); mac_selinux_create_file_clear(); - if (r < 0) return log_debug_errno(errno, "mknod failed for %s: %m", d);