chiark / gitweb /
tree-wide: drop NULL sentinel from strjoin
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 23 Oct 2016 15:43:27 +0000 (11:43 -0400)
committerSven Eden <yamakuzure@gmx.net>
Mon, 17 Jul 2017 15:58:34 +0000 (17:58 +0200)
This makes strjoin and strjoina more similar and avoids the useless final
argument.

spatch -I . -I ./src -I ./src/basic -I ./src/basic -I ./src/shared -I ./src/shared -I ./src/network -I ./src/locale -I ./src/login -I ./src/journal -I ./src/journal -I ./src/timedate -I ./src/timesync -I ./src/nspawn -I ./src/resolve -I ./src/resolve -I ./src/elogind -I ./src/core -I ./src/core -I ./src/libudev -I ./src/udev -I ./src/udev/net -I ./src/udev -I ./src/libelogind/sd-bus -I ./src/libelogind/sd-event -I ./src/libelogind/sd-login -I ./src/libelogind/sd-netlink -I ./src/libelogind/sd-network -I ./src/libelogind/sd-hwdb -I ./src/libelogind/sd-device -I ./src/libelogind/sd-id128 -I ./src/libelogind-network --sp-file coccinelle/strjoin.cocci --in-place $(git ls-files src/*.c)

git grep -e '\bstrjoin\b.*NULL' -l|xargs sed -i -r 's/strjoin\((.*), NULL\)/strjoin(\1)/'

This might have missed a few cases (spatch has a really hard time dealing
with _cleanup_ macros), but that's no big issue, they can always be fixed
later.

19 files changed:
src/basic/cgroup-util.c
src/basic/conf-files.c
src/basic/fileio.c
src/basic/fs-util.c
src/basic/mount-util.c
src/basic/path-util.c
src/basic/process-util.c
src/basic/string-util.c
src/basic/string-util.h
src/basic/unit-name.c
src/basic/util.c
src/core/cgroup.c
src/libelogind/sd-bus/bus-kernel.c
src/libelogind/sd-bus/sd-bus.c
src/login/logind-inhibit.c
src/login/logind-session.c
src/login/pam_elogind.c
src/shared/bus-util.c
src/shared/conf-parser.c

index 44ab535cca2b488303da05a65c4a895499b19d1b..953bb86f63cf3d7a7a8dabc5ae425ba74b514156 100644 (file)
@@ -346,7 +346,7 @@ int cg_kill_recursive(
         while ((r = cg_read_subgroup(d, &fn)) > 0) {
                 _cleanup_free_ char *p = NULL;
 
-                p = strjoin(path, "/", fn, NULL);
+                p = strjoin(path, "/", fn);
                 free(fn);
                 if (!p)
                         return -ENOMEM;
@@ -484,7 +484,7 @@ int cg_migrate_recursive(
         while ((r = cg_read_subgroup(d, &fn)) > 0) {
                 _cleanup_free_ char *p = NULL;
 
-                p = strjoin(pfrom, "/", fn, NULL);
+                p = strjoin(pfrom, "/", fn);
                 free(fn);
                 if (!p)
                         return -ENOMEM;
@@ -567,11 +567,11 @@ static int join_path_legacy(const char *controller, const char *path, const char
         if (isempty(path) && isempty(suffix))
                 t = strappend("/sys/fs/cgroup/", dn);
         else if (isempty(path))
-                t = strjoin("/sys/fs/cgroup/", dn, "/", suffix, NULL);
+                t = strjoin("/sys/fs/cgroup/", dn, "/", suffix);
         else if (isempty(suffix))
-                t = strjoin("/sys/fs/cgroup/", dn, "/", path, NULL);
+                t = strjoin("/sys/fs/cgroup/", dn, "/", path);
         else
-                t = strjoin("/sys/fs/cgroup/", dn, "/", path, "/", suffix, NULL);
+                t = strjoin("/sys/fs/cgroup/", dn, "/", path, "/", suffix);
         if (!t)
                 return -ENOMEM;
 
@@ -591,7 +591,7 @@ static int join_path_unified(const char *path, const char *suffix, char **fs) {
         else if (isempty(suffix))
                 t = strappend("/sys/fs/cgroup/", path);
         else
-                t = strjoin("/sys/fs/cgroup/", path, "/", suffix, NULL);
+                t = strjoin("/sys/fs/cgroup/", path, "/", suffix);
         if (!t)
                 return -ENOMEM;
 
@@ -618,7 +618,7 @@ int cg_get_path(const char *controller, const char *path, const char *suffix, ch
                 else if (!path)
                         t = strdup(suffix);
                 else
-                        t = strjoin(path, "/", suffix, NULL);
+                        t = strjoin(path, "/", suffix);
                 if (!t)
                         return -ENOMEM;
 
@@ -1155,7 +1155,7 @@ int cg_is_empty_recursive(const char *controller, const char *path) {
                 while ((r = cg_read_subgroup(d, &fn)) > 0) {
                         _cleanup_free_ char *p = NULL;
 
-                        p = strjoin(path, "/", fn, NULL);
+                        p = strjoin(path, "/", fn);
                         free(fn);
                         if (!p)
                                 return -ENOMEM;
@@ -2481,10 +2481,8 @@ bool cg_is_unified_systemd_controller_wanted(void) {
                 return wanted;
 
         r = get_proc_cmdline_key("systemd.legacy_systemd_cgroup_controller", NULL);
-        if (r > 0) {
         if (r > 0)
                 wanted = false;
-        } else {
         else {
                 _cleanup_free_ char *value = NULL;
 
index 92fc792d6094e8ab237383b379d2da8373ba4228..950bdf53dee75c597ccc3b1071c701dfa81c5970 100644 (file)
@@ -60,7 +60,7 @@ static int files_add(Hashmap *h, const char *root, const char *path, const char
                 if (!dirent_is_file_with_suffix(de, suffix))
                         continue;
 
-                p = strjoin(dirpath, "/", de->d_name, NULL);
+                p = strjoin(dirpath, "/", de->d_name);
                 if (!p)
                         return -ENOMEM;
 
index 5b20fbb49cbb15149ad7a714876bf503b3ae604a..f4915b28a7092f91d2c3d7ae5f8c2582738b5cf6 100644 (file)
@@ -585,9 +585,14 @@ fail:
         return r;
 }
 
-static int check_utf8ness_and_warn(
+static int parse_env_file_push(
                 const char *filename, unsigned line,
-                const char *key, char *value) {
+                const char *key, char *value,
+                void *userdata,
+                int *n_pushed) {
+
+        const char *k;
+        va_list aq, *ap = userdata;
 
         if (!utf8_is_valid(key)) {
                 _cleanup_free_ char *p = NULL;
@@ -605,23 +610,6 @@ static int check_utf8ness_and_warn(
                 return -EINVAL;
         }
 
-        return 0;
-}
-
-static int parse_env_file_push(
-                const char *filename, unsigned line,
-                const char *key, char *value,
-                void *userdata,
-                int *n_pushed) {
-
-        const char *k;
-        va_list aq, *ap = userdata;
-        int r;
-
-        r = check_utf8ness_and_warn(filename, line, key, value);
-        if (r < 0)
-                return r;
-
         va_copy(aq, *ap);
 
         while ((k = va_arg(aq, const char *))) {
@@ -674,19 +662,27 @@ static int load_env_file_push(
         char *p;
         int r;
 
-        r = check_utf8ness_and_warn(filename, line, key, value);
-        if (r < 0)
-                return r;
+        if (!utf8_is_valid(key)) {
+                _cleanup_free_ char *t = utf8_escape_invalid(key);
+
+                log_error("%s:%u: invalid UTF-8 for key '%s', ignoring.", strna(filename), line, t);
+                return -EINVAL;
+        }
+
+        if (value && !utf8_is_valid(value)) {
+                _cleanup_free_ char *t = utf8_escape_invalid(value);
+
+                log_error("%s:%u: invalid UTF-8 value for key %s: '%s', ignoring.", strna(filename), line, key, t);
+                return -EINVAL;
+        }
 
-        p = strjoin(key, "=", value);
+        p = strjoin(key, "=", strempty(value));
         if (!p)
                 return -ENOMEM;
 
-        r = strv_env_replace(m, p);
-        if (r < 0) {
-                free(p);
+        r = strv_consume(m, p);
+        if (r < 0)
                 return r;
-        }
 
         if (n_pushed)
                 (*n_pushed)++;
@@ -720,9 +716,19 @@ static int load_env_file_push_pairs(
         char ***m = userdata;
         int r;
 
-        r = check_utf8ness_and_warn(filename, line, key, value);
-        if (r < 0)
-                return r;
+        if (!utf8_is_valid(key)) {
+                _cleanup_free_ char *t = utf8_escape_invalid(key);
+
+                log_error("%s:%u: invalid UTF-8 for key '%s', ignoring.", strna(filename), line, t);
+                return -EINVAL;
+        }
+
+        if (value && !utf8_is_valid(value)) {
+                _cleanup_free_ char *t = utf8_escape_invalid(value);
+
+                log_error("%s:%u: invalid UTF-8 value for key %s: '%s', ignoring.", strna(filename), line, key, t);
+                return -EINVAL;
+        }
 
         r = strv_extend(m, key);
         if (r < 0)
@@ -761,51 +767,6 @@ int load_env_file_pairs(FILE *f, const char *fname, const char *newline, char **
         return 0;
 }
 
-static int merge_env_file_push(
-                const char *filename, unsigned line,
-                const char *key, char *value,
-                void *userdata,
-                int *n_pushed) {
-
-        char ***env = userdata;
-        char *expanded_value;
-
-        assert(env);
-
-        if (!value) {
-                log_error("%s:%u: invalid syntax (around \"%s\"), ignoring.", strna(filename), line, key);
-                return 0;
-        }
-
-        if (!env_name_is_valid(key)) {
-                log_error("%s:%u: invalid variable name \"%s\", ignoring.", strna(filename), line, key);
-                return 0;
-        }
-
-        expanded_value = replace_env(value, *env,
-                                     REPLACE_ENV_USE_ENVIRONMENT|
-                                     REPLACE_ENV_ALLOW_BRACELESS|
-                                     REPLACE_ENV_ALLOW_EXTENDED);
-        if (!expanded_value)
-                return -ENOMEM;
-
-        free_and_replace(value, expanded_value);
-
-        return load_env_file_push(filename, line, key, value, env, n_pushed);
-}
-
-int merge_env_file(
-                char ***env,
-                FILE *f,
-                const char *fname) {
-
-        /* NOTE: this function supports braceful and braceless variable expansions,
-         * plus "extended" substitutions, unlike other exported parsing functions.
-         */
-
-        return parse_env_file_internal(f, fname, NEWLINE, merge_env_file_push, env, NULL);
-}
-
 static void write_env_var(FILE *f, const char *v) {
         const char *p;
 
@@ -1385,25 +1346,6 @@ int open_tmpfile_linkable(const char *target, int flags, char **ret_path) {
         return fd;
 }
 
-int open_serialization_fd(const char *ident) {
-        int fd = -1;
-
-        fd = memfd_create(ident, MFD_CLOEXEC);
-        if (fd < 0) {
-                const char *path;
-
-                path = getpid() == 1 ? "/run/systemd" : "/tmp";
-                fd = open_tmpfile_unlinkable(path, O_RDWR|O_CLOEXEC);
-                if (fd < 0)
-                        return fd;
-
-                log_debug("Serializing %s to %s.", ident, path);
-        } else
-                log_debug("Serializing %s to memfd.", ident);
-
-        return fd;
-}
-
 int link_tmpfile(int fd, const char *path, const char *target) {
 
         assert(fd >= 0);
@@ -1472,22 +1414,3 @@ int read_nul_string(FILE *f, char **ret) {
 
         return 0;
 }
-
-int mkdtemp_malloc(const char *template, char **ret) {
-        char *p;
-
-        assert(template);
-        assert(ret);
-
-        p = strdup(template);
-        if (!p)
-                return -ENOMEM;
-
-        if (!mkdtemp(p)) {
-                free(p);
-                return -errno;
-        }
-
-        *ret = p;
-        return 0;
-}
index 59787552d2618519f5ff2e04c886188f321c0326..f288848c9e8f7d52c50e2ab376d9760be37f5863 100644 (file)
@@ -747,7 +747,7 @@ int chase_symlinks(const char *path, const char *_root, char **ret) {
                                 /* A relative destination. If so, this is what we'll prefix what's left to do with what
                                  * we just read, and start the loop again, but remain in the current directory. */
 
-                                joined = strjoin("/", destination, todo, NULL);
+                                joined = strjoin("/", destination, todo);
                                 if (!joined)
                                         return -ENOMEM;
 
index e2bdfcd8a7c9d711e83fc9724a6dd72d5d52d23f..051b14b179596f35b213c3f6685151e9f7409863 100644 (file)
@@ -161,7 +161,7 @@ int fd_is_mount_point(int fd, const char *filename, int flags) {
 
 fallback_fdinfo:
         r = fd_fdinfo_mnt_id(fd, filename, flags, &mount_id);
-        if (IN_SET(r, -EOPNOTSUPP, -EACCES))
+        if (r == -EOPNOTSUPP)
                 goto fallback_fstat;
         if (r < 0)
                 return r;
@@ -525,7 +525,6 @@ bool fstype_is_network(const char *fstype) {
                 "glusterfs\0"
                 "pvfs2\0" /* OrangeFS */
                 "ocfs2\0"
-                "lustre\0"
                 ;
 
         const char *x;
@@ -644,7 +643,7 @@ static char* mount_flags_to_string(long unsigned flags) {
                     FLAG(MS_I_VERSION),
                     FLAG(MS_STRICTATIME),
                     FLAG(MS_LAZYTIME),
-                    y, NULL);
+                    y);
         if (!x)
                 return NULL;
         if (!y)
index 8cb013e6cb2beea724909568d0ca6bed93a55045..25a956e9705ac933426e9e5947e419de485246a1 100644 (file)
@@ -82,7 +82,7 @@ char *path_make_absolute(const char *p, const char *prefix) {
         if (path_is_absolute(p) || !prefix)
                 return strdup(p);
 
-        return strjoin(prefix, "/", p, NULL);
+        return strjoin(prefix, "/", p);
 }
 #endif // 0
 
@@ -104,7 +104,7 @@ int path_make_absolute_cwd(const char *p, char **ret) {
                 if (!cwd)
                         return negative_errno();
 
-                c = strjoin(cwd, "/", p, NULL);
+                c = strjoin(cwd, "/", p);
         }
         if (!c)
                 return -ENOMEM;
@@ -356,16 +356,6 @@ char* path_startswith(const char *path, const char *prefix) {
         assert(path);
         assert(prefix);
 
-        /* Returns a pointer to the start of the first component after the parts matched by
-         * the prefix, iff
-         * - both paths are absolute or both paths are relative,
-         * and
-         * - each component in prefix in turn matches a component in path at the same position.
-         * An empty string will be returned when the prefix and path are equivalent.
-         *
-         * Returns NULL otherwise.
-         */
-
         if ((path[0] == '/') != (prefix[0] == '/'))
                 return NULL;
 
@@ -457,13 +447,11 @@ char* path_join(const char *root, const char *path, const char *rest) {
                 return strjoin(root, endswith(root, "/") ? "" : "/",
                                path[0] == '/' ? path+1 : path,
                                rest ? (endswith(path, "/") ? "" : "/") : NULL,
-                               rest && rest[0] == '/' ? rest+1 : rest,
-                               NULL);
+                               rest && rest[0] == '/' ? rest+1 : rest);
         else
                 return strjoin(path,
                                rest ? (endswith(path, "/") ? "" : "/") : NULL,
-                               rest && rest[0] == '/' ? rest+1 : rest,
-                               NULL);
+                               rest && rest[0] == '/' ? rest+1 : rest);
 }
 
 int find_binary(const char *name, char **ret) {
@@ -507,7 +495,7 @@ int find_binary(const char *name, char **ret) {
                 if (!path_is_absolute(element))
                         continue;
 
-                j = strjoin(element, "/", name, NULL);
+                j = strjoin(element, "/", name);
                 if (!j)
                         return -ENOMEM;
 
index cd9c0f7e5d5155abf9ea63fed1d6b7b292112ec4..359c3a4e4e00dfd015c2802ffd1e1e37ff227704 100644 (file)
@@ -235,14 +235,14 @@ int get_process_cmdline(pid_t pid, size_t max_length, bool comm_fallback, char *
                         return h;
 
                 if (max_length == 0)
-                        r = strjoin("[", t, "]", NULL);
+                        r = strjoin("[", t, "]");
                 else {
                         size_t l;
 
                         l = strlen(t);
 
                         if (l + 3 <= max_length)
-                                r = strjoin("[", t, "]", NULL);
+                                r = strjoin("[", t, "]");
                         else if (max_length <= 6) {
 
                                 r = new(char, max_length);
@@ -262,7 +262,7 @@ int get_process_cmdline(pid_t pid, size_t max_length, bool comm_fallback, char *
                                         e--;
                                 *e = 0;
 
-                                r = strjoin("[", t, "...]", NULL);
+                                r = strjoin("[", t, "...]");
                         }
                 }
                 if (!r)
index ebe146b03d817eab23e85990ce121fcf7c5a7b37..b906b581c9a2d228d531aa107304790498ba0fce 100644 (file)
@@ -218,7 +218,7 @@ char *strappend(const char *s, const char *suffix) {
         return strnappend(s, suffix, suffix ? strlen(suffix) : 0);
 }
 
-char *strjoin(const char *x, ...) {
+char *strjoin_real(const char *x, ...) {
         va_list ap;
         size_t l;
         char *r, *p;
index 66e55cb2c615ab8cbab8fce97cd730068d395772..4b5cb8c7011dfd534fef49bf9e8eb180ae6847bc 100644 (file)
@@ -120,7 +120,8 @@ const char* split(const char **state, size_t *l, const char *separator, bool quo
 char *strappend(const char *s, const char *suffix);
 char *strnappend(const char *s, const char *suffix, size_t length);
 
-char *strjoin(const char *x, ...) _sentinel_;
+char *strjoin_real(const char *x, ...) _sentinel_;
+#define strjoin(a, ...) strjoin_real((a), __VA_ARGS__, NULL)
 
 #define strjoina(a, ...)                                                \
         ({                                                              \
index 463301eebffdac579a9ebe3d1a978f7071b620bb..21fec7316eb5be5c1c3975fe32b6bc3e2d186ec1 100644 (file)
@@ -275,7 +275,7 @@ int unit_name_build(const char *prefix, const char *instance, const char *suffix
         if (!instance)
                 s = strappend(prefix, suffix);
         else
-                s = strjoin(prefix, "@", instance, suffix, NULL);
+                s = strjoin(prefix, "@", instance, suffix);
         if (!s)
                 return -ENOMEM;
 
@@ -557,7 +557,7 @@ int unit_name_from_path_instance(const char *prefix, const char *path, const cha
         if (r < 0)
                 return r;
 
-        s = strjoin(prefix, "@", p, suffix, NULL);
+        s = strjoin(prefix, "@", p, suffix);
         if (!s)
                 return -ENOMEM;
 
index 27c3d483931d6ed5c39861b1707931ccff621087..c73a7df19bb89d07a7d42fb04d92e2dc36123f8a 100644 (file)
@@ -131,7 +131,7 @@ static int do_execute(char **directories, usec_t timeout, char *argv[]) {
                         if (r < 0)
                                 return log_oom();
 
-                        path = strjoin(*directory, "/", de->d_name, NULL);
+                        path = strjoin(*directory, "/", de->d_name);
                         if (!path)
                                 return log_oom();
 
index a524a411004615d6ba67c3ea51419331a5a3c22f..5ee5bd79555b36cd10cb6619ba60f8ef6fa9e9ac 100644 (file)
@@ -1203,9 +1203,10 @@ char *unit_default_cgroup_path(Unit *u) {
                 return NULL;
 
         if (slice)
-                return strjoin(u->manager->cgroup_root, "/", slice, "/", escaped, NULL);
+                return strjoin(u->manager->cgroup_root, "/", slice, "/",
+                               escaped);
         else
-                return strjoin(u->manager->cgroup_root, "/", escaped, NULL);
+                return strjoin(u->manager->cgroup_root, "/", escaped);
 }
 
 int unit_set_cgroup_path(Unit *u, const char *path) {
@@ -1645,7 +1646,7 @@ static int unit_watch_pids_in_path(Unit *u, const char *path) {
                 while ((r = cg_read_subgroup(d, &fn)) > 0) {
                         _cleanup_free_ char *p = NULL;
 
-                        p = strjoin(path, "/", fn, NULL);
+                        p = strjoin(path, "/", fn);
                         free(fn);
 
                         if (!p)
index 5db011b710cd9f2de18f92c3166663297038dfae..4fa06b75e342a941c717698b8252d29a63b99e7c 100644 (file)
@@ -1650,7 +1650,7 @@ int bus_kernel_create_bus(const char *name, bool world, char **s) {
         if (s) {
                 char *p;
 
-                p = strjoin("/sys/fs/kdbus/", n->str, "/bus", NULL);
+                p = strjoin("/sys/fs/kdbus/", n->str, "/bus");
                 if (!p) {
                         safe_close(fd);
                         return -ENOMEM;
index 3c6b210bd2a7fc279e17bb7d2e7622765bb211a9..4173ecde66904808fa1ae5a371cbabf94ba76887 100644 (file)
@@ -1355,7 +1355,7 @@ int bus_set_address_system_remote(sd_bus *b, const char *host) {
                         return -ENOMEM;
         }
 
-        b->address = strjoin("unixexec:path=ssh,argv1=-xT,argv2=", e, ",argv3=systemd-stdio-bridge", c, NULL);
+        b->address = strjoin("unixexec:path=ssh,argv1=-xT,argv2=", e, ",argv3=systemd-stdio-bridge", c);
         if (!b->address)
                 return -ENOMEM;
 
@@ -1403,7 +1403,7 @@ int bus_set_address_system_machine(sd_bus *b, const char *machine) {
         if (!e)
                 return -ENOMEM;
 
-        b->address = strjoin("x-machine-kernel:machine=", e, ";x-machine-unix:machine=", e, NULL);
+        b->address = strjoin("x-machine-kernel:machine=", e, ";x-machine-unix:machine=", e);
         if (!b->address)
                 return -ENOMEM;
 
@@ -3511,7 +3511,7 @@ _public_ int sd_bus_path_encode(const char *prefix, const char *external_id, cha
         if (!e)
                 return -ENOMEM;
 
-        ret = strjoin(prefix, "/", e, NULL);
+        ret = strjoin(prefix, "/", e);
         if (!ret)
                 return -ENOMEM;
 
index c93b24009bbc451ebca77c987c6f3606be18cd2f..a7e5c01ef38a16769c5a1584a37a06cfb61c185c 100644 (file)
@@ -294,7 +294,7 @@ int inhibitor_create_fifo(Inhibitor *i) {
                 if (r < 0)
                         return r;
 
-                i->fifo_path = strjoin("/run/systemd/inhibit/", i->id, ".ref", NULL);
+                i->fifo_path = strjoin("/run/systemd/inhibit/", i->id, ".ref");
                 if (!i->fifo_path)
                         return -ENOMEM;
 
index b8071264b9533e9d6eac985d8e0d9a969189f31f..9123d50fac012d0e9a24666316ae5c145ebc0608 100644 (file)
@@ -512,7 +512,7 @@ static int session_start_scope(Session *s) {
                 char *scope, *job = NULL;
                 const char *description;
 
-                scope = strjoin("session-", s->id, ".scope", NULL);
+                scope = strjoin("session-", s->id, ".scope");
                 if (!scope)
                         return log_oom();
 
index 4f023640f6517f953a74d4036e27604677b06f2f..b0f75b2a21c4941ec8fd5f81c11b55eb533bb1b1 100644 (file)
@@ -186,7 +186,7 @@ static int export_legacy_dbus_address(
          * daemons that spawn dbus-daemon, instead of forcing
          * DBUS_SESSION_BUS_ADDRESS= here. */
 
-        s = strjoin(runtime, "/bus", NULL);
+        s = strjoin(runtime, "/bus");
         if (!s)
                 goto error;
 
index 8bba92092f51eac37102818faba3cef111888d57..0d64ec196483ecbb2328dc82c7e8576c096d12f1 100644 (file)
@@ -679,7 +679,7 @@ int bus_connect_user_systemd(sd_bus **_bus) {
         if (r < 0)
                 return r;
 
-        bus->address = strjoin("unix:path=", ee, "/systemd/private", NULL);
+        bus->address = strjoin("unix:path=", ee, "/systemd/private");
         if (!bus->address)
                 return -ENOMEM;
 
@@ -1475,7 +1475,7 @@ int bus_path_encode_unique(sd_bus *b, const char *prefix, const char *sender_id,
         if (!external_label)
                 return -ENOMEM;
 
-        p = strjoin(prefix, "/", sender_label, "/", external_label, NULL);
+        p = strjoin(prefix, "/", sender_label, "/", external_label);
         if (!p)
                 return -ENOMEM;
 
index 90f3167f523dc39233743d0b0f6b9027e9456bc8..78757d534e6288261ebdb3a36f7220c3fcd1c067 100644 (file)
@@ -100,7 +100,7 @@ int config_item_perf_lookup(
         else {
                 char *key;
 
-                key = strjoin(section, ".", lvalue, NULL);
+                key = strjoin(section, ".", lvalue);
                 if (!key)
                         return -ENOMEM;