diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | ext/alsaspdif/alsaspdifsink.c | 28 |
2 files changed, 24 insertions, 11 deletions
@@ -1,3 +1,10 @@ +2007-11-29 Wim Taymans <wim.taymans@gmail.com> + + * ext/alsaspdif/alsaspdifsink.c: (alsaspdifsink_set_caps), + (alsaspdifsink_get_time), (alsaspdifsink_set_params), + (alsaspdifsink_find_pcm_device): + Don't free uninitialized data when we are in error. + 2007-11-28 Edgard Lima <edgard.lima@indt.org.br> * ext/metadata/gstmetadatamux.c: diff --git a/ext/alsaspdif/alsaspdifsink.c b/ext/alsaspdif/alsaspdifsink.c index 15248614..18c26ab9 100644 --- a/ext/alsaspdif/alsaspdifsink.c +++ b/ext/alsaspdif/alsaspdifsink.c @@ -475,11 +475,11 @@ alsaspdifsink_find_pcm_device (AlsaSPDIFSink * sink) int card = sink->card; gchar pcm_name[24]; snd_pcm_t *pcm = NULL; - snd_ctl_t *ctl; - snd_ctl_card_info_t *info; - snd_ctl_elem_list_t *clist; - snd_ctl_elem_id_t *cid; - snd_pcm_info_t *pinfo; + snd_ctl_t *ctl = NULL; + snd_ctl_card_info_t *info = NULL; + snd_ctl_elem_list_t *clist = NULL; + snd_ctl_elem_id_t *cid = NULL; + snd_pcm_info_t *pinfo = NULL; GST_WARNING ("Opening IEC958 named device failed. Trying to autodetect"); @@ -585,12 +585,18 @@ alsaspdifsink_find_pcm_device (AlsaSPDIFSink * sink) beach: if (pcm) snd_pcm_close (pcm); - snd_ctl_elem_list_clear (clist); - snd_ctl_close (ctl); - snd_ctl_elem_list_free (clist); - snd_ctl_elem_id_free (cid); - snd_ctl_card_info_free (info); - snd_pcm_info_free (pinfo); + if (clist) + snd_ctl_elem_list_clear (clist); + if (ctl) + snd_ctl_close (ctl); + if (clist) + snd_ctl_elem_list_free (clist); + if (cid) + snd_ctl_elem_id_free (cid); + if (info) + snd_ctl_card_info_free (info); + if (pinfo) + snd_pcm_info_free (pinfo); return err; } |