aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/pulse_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-03-26 19:50:10 +0100
committerMax Kellermann <max@duempel.org>2009-03-26 19:50:10 +0100
commit52575d1b9da611a2b766e6f96fb838ff49e17771 (patch)
tree3c457c85268816ec2dabcee03627fd6819bb680a /src/output/pulse_plugin.c
parentcd4964cdeee41abab7773fc0c9dd6d5592351726 (diff)
downloadmpd-52575d1b9da611a2b766e6f96fb838ff49e17771.tar.gz
mpd-52575d1b9da611a2b766e6f96fb838ff49e17771.tar.xz
mpd-52575d1b9da611a2b766e6f96fb838ff49e17771.zip
pulse: make configuration strings const
Nobody needs to modify these strings. We can make them const, and convert config_dup_block_string() to config_get_block_string(). This also fixes memory leaks in the pulse mixer.
Diffstat (limited to 'src/output/pulse_plugin.c')
-rw-r--r--src/output/pulse_plugin.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/output/pulse_plugin.c b/src/output/pulse_plugin.c
index fdab02599..ffc7abc8b 100644
--- a/src/output/pulse_plugin.c
+++ b/src/output/pulse_plugin.c
@@ -28,10 +28,10 @@
struct pulse_data {
const char *name;
+ const char *server;
+ const char *sink;
pa_simple *s;
- char *server;
- char *sink;
};
/**
@@ -57,8 +57,6 @@ static struct pulse_data *pulse_new_data(void)
static void pulse_free_data(struct pulse_data *pd)
{
- g_free(pd->server);
- g_free(pd->sink);
g_free(pd);
}
@@ -70,8 +68,8 @@ pulse_init(G_GNUC_UNUSED const struct audio_format *audio_format,
pd = pulse_new_data();
pd->name = config_get_block_string(param, "name", "mpd_pulse");
- pd->server = config_dup_block_string(param, "server", NULL);
- pd->sink = config_dup_block_string(param, "sink", NULL);
+ pd->server = config_get_block_string(param, "server", NULL);
+ pd->sink = config_get_block_string(param, "sink", NULL);
return pd;
}