aboutsummaryrefslogtreecommitdiffstats
path: root/src/mixer/alsa_mixer.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-18 18:55:51 +0100
committerMax Kellermann <max@duempel.org>2009-01-18 18:55:51 +0100
commita0603d8897a7066564172c086b6e532d8a5a40c5 (patch)
treee97171482bfaff4872c6bb1802c712626f432c65 /src/mixer/alsa_mixer.c
parent5ba43e4ac2ea37166b583965ea024a8ace36aeea (diff)
downloadmpd-a0603d8897a7066564172c086b6e532d8a5a40c5.tar.gz
mpd-a0603d8897a7066564172c086b6e532d8a5a40c5.tar.xz
mpd-a0603d8897a7066564172c086b6e532d8a5a40c5.zip
mixer: don't check for NULL before g_free()
The g_free() function includes a NULL check. We don't have to do it twice.
Diffstat (limited to '')
-rw-r--r--src/mixer/alsa_mixer.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/mixer/alsa_mixer.c b/src/mixer/alsa_mixer.c
index 2433d5b9c..72924058b 100644
--- a/src/mixer/alsa_mixer.c
+++ b/src/mixer/alsa_mixer.c
@@ -36,10 +36,9 @@ static void
alsa_mixer_finish(struct mixer_data *data)
{
struct alsa_mixer *am = (struct alsa_mixer *)data;
- if (am->device)
- g_free(am->device);
- if (am->control)
- g_free(am->control);
+
+ g_free(am->device);
+ g_free(am->control);
g_free(am);
}
@@ -53,13 +52,11 @@ alsa_mixer_configure(struct mixer_data *data, struct config_param *param)
return;
if ((bp = getBlockParam(param, "mixer_device"))) {
- if (am->device)
- g_free(am->device);
+ g_free(am->device);
am->device = g_strdup(bp->value);
}
if ((bp = getBlockParam(param, "mixer_control"))) {
- if (am->control)
- g_free(am->control);
+ g_free(am->control);
am->control = g_strdup(bp->value);
}
}