summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-control.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-04-14 17:43:59 +0200
committerLennart Poettering <lennart@poettering.net>2013-04-14 17:43:59 +0200
commited5c5dbde1575d74c87ae9856fe61268d7ae8f4b (patch)
treef9cf03c29268df9b37e7f1cfd455752f8ef3ca74 /src/libsystemd-bus/bus-control.c
parent01f6c9d4685edbc38c8df9175286f0e312dc1938 (diff)
util: introduce alloca0() and use it at a number of places
Diffstat (limited to 'src/libsystemd-bus/bus-control.c')
-rw-r--r--src/libsystemd-bus/bus-control.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/libsystemd-bus/bus-control.c b/src/libsystemd-bus/bus-control.c
index 5296029fd6..e980bfc740 100644
--- a/src/libsystemd-bus/bus-control.c
+++ b/src/libsystemd-bus/bus-control.c
@@ -66,10 +66,9 @@ int sd_bus_request_name(sd_bus *bus, const char *name, int flags) {
size_t l;
l = strlen(name);
- n = alloca(offsetof(struct kdbus_cmd_name, name) + l + 1);
+ n = alloca0(offsetof(struct kdbus_cmd_name, name) + l + 1);
n->size = offsetof(struct kdbus_cmd_name, name) + l + 1;
n->name_flags = flags;
- n->id = 0;
memcpy(n->name, name, l+1);
#ifdef HAVE_VALGRIND_MEMCHECK_H
@@ -121,10 +120,8 @@ int sd_bus_release_name(sd_bus *bus, const char *name) {
size_t l;
l = strlen(name);
- n = alloca(offsetof(struct kdbus_cmd_name, name) + l + 1);
+ n = alloca0(offsetof(struct kdbus_cmd_name, name) + l + 1);
n->size = offsetof(struct kdbus_cmd_name, name) + l + 1;
- n->name_flags = 0;
- n->id = 0;
memcpy(n->name, name, l+1);
#ifdef HAVE_VALGRIND_MEMCHECK_H