summaryrefslogtreecommitdiff
path: root/config/dbus.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-08-09 11:21:06 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-08-22 15:56:50 +1000
commit20a61845d3c93c337bf3331a6bac30cf66c2a293 (patch)
tree11df4240e6628f211ab48c9b75d066f7d399968c /config/dbus.c
parentd33652dad8838ab0a9175ca4613a3161ebc5676f (diff)
downloadxserver-20a61845d3c93c337bf3331a6bac30cf66c2a293.tar.gz
config: use add_option for '_source' too
_source was being allocated manually, with all other options added to that list through add_option. Skip the manual part, allocate the first option _source with add_option too. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'config/dbus.c')
-rw-r--r--config/dbus.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/config/dbus.c b/config/dbus.c
index 34e3caade..41eca998a 100644
--- a/config/dbus.c
+++ b/config/dbus.c
@@ -80,15 +80,7 @@ add_device(DBusMessage *message, DBusMessage *reply, DBusError *error)
MALFORMED_MESSAGE();
}
- options = calloc(sizeof(*options), 1);
- if (!options) {
- ErrorF("[config/dbus] couldn't allocate option\n");
- return BadAlloc;
- }
-
- options->key = strdup("_source");
- options->value = strdup("client/dbus");
- if (!options->key || !options->value) {
+ if (!add_option(&options, "_source", "client/dbus")) {
ErrorF("[config/dbus] couldn't allocate first key/value pair\n");
ret = BadAlloc;
goto unwind;