diff options
author | Daniel Mack <daniel@zonque.org> | 2015-07-29 20:25:57 +0200 |
---|---|---|
committer | Daniel Mack <daniel@zonque.org> | 2015-07-30 13:09:01 +0200 |
commit | 2fc09a9cdd1ad25bc7c53a23d5301eb952e1ce3d (patch) | |
tree | c662c5bf209dae93822ac07a831882a7ba4ba0b2 /src/libsystemd/sd-bus | |
parent | 5f17089ac1e86c25806d3f066243561360efd2ca (diff) |
tree-wide: use free_and_strdup()
Use free_and_strdup() where appropriate and replace equivalent,
open-coded versions.
Diffstat (limited to 'src/libsystemd/sd-bus')
-rw-r--r-- | src/libsystemd/sd-bus/sd-bus.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c index 0ca225c617..767df40e81 100644 --- a/src/libsystemd/sd-bus/sd-bus.c +++ b/src/libsystemd/sd-bus/sd-bus.c @@ -896,10 +896,9 @@ static int parse_container_kernel_address(sd_bus *b, const char **p, char **guid } else b->nspid = 0; - free(b->kernel); - b->kernel = strdup("/sys/fs/kdbus/0-system/bus"); - if (!b->kernel) - return -ENOMEM; + r = free_and_strdup(&b->kernel, "/sys/fs/kdbus/0-system/bus"); + if (r < 0) + return r; return 0; } |