提交 fb7da626 编写于 作者: M Markus Armbruster 提交者: Gerd Hoffmann

audio: Drop superfluous conditionals around g_free()

Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
上级 2a2c4830
...@@ -815,10 +815,8 @@ static void alsa_fini_out (HWVoiceOut *hw) ...@@ -815,10 +815,8 @@ static void alsa_fini_out (HWVoiceOut *hw)
ldebug ("alsa_fini\n"); ldebug ("alsa_fini\n");
alsa_anal_close (&alsa->handle, &alsa->pollhlp); alsa_anal_close (&alsa->handle, &alsa->pollhlp);
if (alsa->pcm_buf) { g_free(alsa->pcm_buf);
g_free (alsa->pcm_buf);
alsa->pcm_buf = NULL; alsa->pcm_buf = NULL;
}
} }
static int alsa_init_out (HWVoiceOut *hw, struct audsettings *as) static int alsa_init_out (HWVoiceOut *hw, struct audsettings *as)
...@@ -978,10 +976,8 @@ static void alsa_fini_in (HWVoiceIn *hw) ...@@ -978,10 +976,8 @@ static void alsa_fini_in (HWVoiceIn *hw)
alsa_anal_close (&alsa->handle, &alsa->pollhlp); alsa_anal_close (&alsa->handle, &alsa->pollhlp);
if (alsa->pcm_buf) { g_free(alsa->pcm_buf);
g_free (alsa->pcm_buf);
alsa->pcm_buf = NULL; alsa->pcm_buf = NULL;
}
} }
static int alsa_run_in (HWVoiceIn *hw) static int alsa_run_in (HWVoiceIn *hw)
......
...@@ -71,10 +71,7 @@ static void glue (audio_init_nb_voices_, TYPE) (struct audio_driver *drv) ...@@ -71,10 +71,7 @@ static void glue (audio_init_nb_voices_, TYPE) (struct audio_driver *drv)
static void glue (audio_pcm_hw_free_resources_, TYPE) (HW *hw) static void glue (audio_pcm_hw_free_resources_, TYPE) (HW *hw)
{ {
if (HWBUF) {
g_free (HWBUF); g_free (HWBUF);
}
HWBUF = NULL; HWBUF = NULL;
} }
...@@ -92,9 +89,7 @@ static int glue (audio_pcm_hw_alloc_resources_, TYPE) (HW *hw) ...@@ -92,9 +89,7 @@ static int glue (audio_pcm_hw_alloc_resources_, TYPE) (HW *hw)
static void glue (audio_pcm_sw_free_resources_, TYPE) (SW *sw) static void glue (audio_pcm_sw_free_resources_, TYPE) (SW *sw)
{ {
if (sw->buf) {
g_free (sw->buf); g_free (sw->buf);
}
if (sw->rate) { if (sw->rate) {
st_rate_stop (sw->rate); st_rate_stop (sw->rate);
...@@ -172,10 +167,8 @@ static int glue (audio_pcm_sw_init_, TYPE) ( ...@@ -172,10 +167,8 @@ static int glue (audio_pcm_sw_init_, TYPE) (
static void glue (audio_pcm_sw_fini_, TYPE) (SW *sw) static void glue (audio_pcm_sw_fini_, TYPE) (SW *sw)
{ {
glue (audio_pcm_sw_free_resources_, TYPE) (sw); glue (audio_pcm_sw_free_resources_, TYPE) (sw);
if (sw->name) {
g_free (sw->name); g_free (sw->name);
sw->name = NULL; sw->name = NULL;
}
} }
static void glue (audio_pcm_hw_add_sw_, TYPE) (HW *hw, SW *sw) static void glue (audio_pcm_hw_add_sw_, TYPE) (HW *hw, SW *sw)
......
...@@ -736,10 +736,8 @@ static void oss_fini_in (HWVoiceIn *hw) ...@@ -736,10 +736,8 @@ static void oss_fini_in (HWVoiceIn *hw)
oss_anal_close (&oss->fd); oss_anal_close (&oss->fd);
if (oss->pcm_buf) { g_free(oss->pcm_buf);
g_free (oss->pcm_buf);
oss->pcm_buf = NULL; oss->pcm_buf = NULL;
}
} }
static int oss_run_in (HWVoiceIn *hw) static int oss_run_in (HWVoiceIn *hw)
......
...@@ -275,9 +275,7 @@ static void Adlib_fini (AdlibState *s) ...@@ -275,9 +275,7 @@ static void Adlib_fini (AdlibState *s)
} }
#endif #endif
if (s->mixbuf) { g_free(s->mixbuf);
g_free (s->mixbuf);
}
s->active = 0; s->active = 0;
s->enabled = 0; s->enabled = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册