summaryrefslogtreecommitdiff
path: root/src/core/dbus-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/dbus-manager.c')
-rw-r--r--src/core/dbus-manager.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
index ed9784b58f..2010241e6a 100644
--- a/src/core/dbus-manager.c
+++ b/src/core/dbus-manager.c
@@ -352,17 +352,21 @@ static int bus_manager_set_log_target(DBusMessageIter *i, const char *property,
}
static int bus_manager_append_log_level(DBusMessageIter *i, const char *property, void *data) {
- const char *t;
+ char *t;
+ int r;
assert(i);
assert(property);
- t = log_level_to_string(log_get_max_level());
+ r = log_level_to_string_alloc(log_get_max_level(), &t);
+ if (r < 0)
+ return r;
if (!dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &t))
- return -ENOMEM;
+ r = -ENOMEM;
- return 0;
+ free(t);
+ return r;
}
static int bus_manager_set_log_level(DBusMessageIter *i, const char *property, void *data) {