summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-10-23 11:43:27 -0400
committerSven Eden <yamakuzure@gmx.net>2017-07-17 17:58:34 +0200
commit648294227e8247f729d8cca927d3445ab1836f30 (patch)
treeadbf4fb9771243040d63c819d5a736f4de65d530
parent910c586574a52c6b4cbc6638193797008da076c7 (diff)
tree-wide: drop NULL sentinel from strjoin
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.
-rw-r--r--src/basic/cgroup-util.c18
-rw-r--r--src/basic/conf-files.c2
-rw-r--r--src/basic/fileio.c149
-rw-r--r--src/basic/fs-util.c2
-rw-r--r--src/basic/mount-util.c5
-rw-r--r--src/basic/path-util.c22
-rw-r--r--src/basic/process-util.c6
-rw-r--r--src/basic/string-util.c2
-rw-r--r--src/basic/string-util.h3
-rw-r--r--src/basic/unit-name.c4
-rw-r--r--src/basic/util.c2
-rw-r--r--src/core/cgroup.c7
-rw-r--r--src/libelogind/sd-bus/bus-kernel.c2
-rw-r--r--src/libelogind/sd-bus/sd-bus.c6
-rw-r--r--src/login/logind-inhibit.c2
-rw-r--r--src/login/logind-session.c2
-rw-r--r--src/login/pam_elogind.c2
-rw-r--r--src/shared/bus-util.c4
-rw-r--r--src/shared/conf-parser.c2
19 files changed, 76 insertions, 166 deletions
diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
index 44ab535cc..953bb86f6 100644
--- a/src/basic/cgroup-util.c
+++ b/src/basic/cgroup-util.c
@@ -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;
diff --git a/src/basic/conf-files.c b/src/basic/conf-files.c
index 92fc792d6..950bdf53d 100644
--- a/src/basic/conf-files.c
+++ b/src/basic/conf-files.c
@@ -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;
diff --git a/src/basic/fileio.c b/src/basic/fileio.c
index 5b20fbb49..f4915b28a 100644
--- a/src/basic/fileio.c
+++ b/src/basic/fileio.c
@@ -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;
-}
diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c
index 59787552d..f288848c9 100644
--- a/src/basic/fs-util.c
+++ b/src/basic/fs-util.c
@@ -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;
diff --git a/src/basic/mount-util.c b/src/basic/mount-util.c
index e2bdfcd8a..051b14b17 100644
--- a/src/basic/mount-util.c
+++ b/src/basic/mount-util.c
@@ -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)
diff --git a/src/basic/path-util.c b/src/basic/path-util.c
index 8cb013e6c..25a956e97 100644
--- a/src/basic/path-util.c
+++ b/src/basic/path-util.c
@@ -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;
diff --git a/src/basic/process-util.c b/src/basic/process-util.c
index cd9c0f7e5..359c3a4e4 100644
--- a/src/basic/process-util.c
+++ b/src/basic/process-util.c
@@ -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)
diff --git a/src/basic/string-util.c b/src/basic/string-util.c
index ebe146b03..b906b581c 100644
--- a/src/basic/string-util.c
+++ b/src/basic/string-util.c
@@ -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;
diff --git a/src/basic/string-util.h b/src/basic/string-util.h
index 66e55cb2c..4b5cb8c70 100644
--- a/src/basic/string-util.h
+++ b/src/basic/string-util.h
@@ -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, ...) \
({ \
diff --git a/src/basic/unit-name.c b/src/basic/unit-name.c
index 463301eeb..21fec7316 100644
--- a/src/basic/unit-name.c
+++ b/src/basic/unit-name.c
@@ -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;
diff --git a/src/basic/util.c b/src/basic/util.c
index 27c3d4839..c73a7df19 100644
--- a/src/basic/util.c
+++ b/src/basic/util.c
@@ -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();
diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index a524a4110..5ee5bd795 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -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)
diff --git a/src/libelogind/sd-bus/bus-kernel.c b/src/libelogind/sd-bus/bus-kernel.c
index 5db011b71..4fa06b75e 100644
--- a/src/libelogind/sd-bus/bus-kernel.c
+++ b/src/libelogind/sd-bus/bus-kernel.c
@@ -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;
diff --git a/src/libelogind/sd-bus/sd-bus.c b/src/libelogind/sd-bus/sd-bus.c
index 3c6b210bd..4173ecde6 100644
--- a/src/libelogind/sd-bus/sd-bus.c
+++ b/src/libelogind/sd-bus/sd-bus.c
@@ -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;
diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c
index c93b24009..a7e5c01ef 100644
--- a/src/login/logind-inhibit.c
+++ b/src/login/logind-inhibit.c
@@ -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;
diff --git a/src/login/logind-session.c b/src/login/logind-session.c
index b8071264b..9123d50fa 100644
--- a/src/login/logind-session.c
+++ b/src/login/logind-session.c
@@ -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();
diff --git a/src/login/pam_elogind.c b/src/login/pam_elogind.c
index 4f023640f..b0f75b2a2 100644
--- a/src/login/pam_elogind.c
+++ b/src/login/pam_elogind.c
@@ -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;
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c
index 8bba92092..0d64ec196 100644
--- a/src/shared/bus-util.c
+++ b/src/shared/bus-util.c
@@ -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;
diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c
index 90f3167f5..78757d534 100644
--- a/src/shared/conf-parser.c
+++ b/src/shared/conf-parser.c
@@ -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;