aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/output/roar_output_plugin.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/output/roar_output_plugin.c b/src/output/roar_output_plugin.c
index 2707d33ec..b92efd4cb 100644
--- a/src/output/roar_output_plugin.c
+++ b/src/output/roar_output_plugin.c
@@ -95,14 +95,11 @@ roar_configure(struct roar * self, const struct config_param *param)
{
self->host = config_dup_block_string(param, "server", NULL);
self->name = config_dup_block_string(param, "name", "MPD");
- char *role = config_dup_block_string(param, "role", "music");
- if (role != NULL)
- {
- self->role = roar_str2role(role);
- g_free(role);
- }
- else
- self->role = ROAR_ROLE_MUSIC;
+
+ const char *role = config_get_block_string(param, "role", "music");
+ self->role = role != NULL
+ ? roar_str2role(role)
+ : ROAR_ROLE_MUSIC;
}
static void *