ext/alsaspdif/alsaspdifsink.c: Don't free uninitialized data when we are in error.

Original commit message from CVS:
* 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.
This commit is contained in:
Wim Taymans 2007-11-29 10:44:54 +00:00
parent 14da2ceef5
commit e8af48c02b
2 changed files with 24 additions and 11 deletions

View file

@ -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> 2007-11-28 Edgard Lima <edgard.lima@indt.org.br>
* ext/metadata/gstmetadatamux.c: * ext/metadata/gstmetadatamux.c:

View file

@ -475,11 +475,11 @@ alsaspdifsink_find_pcm_device (AlsaSPDIFSink * sink)
int card = sink->card; int card = sink->card;
gchar pcm_name[24]; gchar pcm_name[24];
snd_pcm_t *pcm = NULL; snd_pcm_t *pcm = NULL;
snd_ctl_t *ctl; snd_ctl_t *ctl = NULL;
snd_ctl_card_info_t *info; snd_ctl_card_info_t *info = NULL;
snd_ctl_elem_list_t *clist; snd_ctl_elem_list_t *clist = NULL;
snd_ctl_elem_id_t *cid; snd_ctl_elem_id_t *cid = NULL;
snd_pcm_info_t *pinfo; snd_pcm_info_t *pinfo = NULL;
GST_WARNING ("Opening IEC958 named device failed. Trying to autodetect"); GST_WARNING ("Opening IEC958 named device failed. Trying to autodetect");
@ -585,12 +585,18 @@ alsaspdifsink_find_pcm_device (AlsaSPDIFSink * sink)
beach: beach:
if (pcm) if (pcm)
snd_pcm_close (pcm); snd_pcm_close (pcm);
snd_ctl_elem_list_clear (clist); if (clist)
snd_ctl_close (ctl); snd_ctl_elem_list_clear (clist);
snd_ctl_elem_list_free (clist); if (ctl)
snd_ctl_elem_id_free (cid); snd_ctl_close (ctl);
snd_ctl_card_info_free (info); if (clist)
snd_pcm_info_free (pinfo); 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; return err;
} }