diff options
Diffstat (limited to 'src/mixer/oss_mixer.c')
-rw-r--r-- | src/mixer/oss_mixer.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/mixer/oss_mixer.c b/src/mixer/oss_mixer.c index db8431ab9..75f1f5a0b 100644 --- a/src/mixer/oss_mixer.c +++ b/src/mixer/oss_mixer.c @@ -19,8 +19,8 @@ #define VOLUME_MIXER_OSS_DEFAULT "/dev/mixer" struct oss_mixer { - const char *device; - const char *control; + char *device; + char *control; int device_fd; int volume_control; }; @@ -40,6 +40,10 @@ static void oss_mixer_finish(struct mixer_data *data) { struct oss_mixer *om = (struct oss_mixer *) data; + if (om->device) + g_free(om->device); + if (om->control) + g_free(om->control); g_free(om); } @@ -50,11 +54,15 @@ oss_mixer_configure(struct mixer_data *data, ConfigParam *param) BlockParam *bp; bp = getBlockParam(param, "mixer_device"); if (bp) { - om->device = bp->value; + if (om->device) + g_free(om->device); + om->device = g_strdup(bp->value); } bp = getBlockParam(param, "mixer_control"); if (bp) { - om->control = bp->value; + if (om->control) + g_free(om->control); + om->control = g_strdup(bp->value); } } |