diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2007-11-29 10:44:54 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2007-11-29 10:44:54 +0000 |
commit | e8af48c02bbfe197d10386aa4b413c9d64bb6fc9 (patch) | |
tree | a4d5f5ba91cd73b4cdf0943167cdf175a30718b7 /ext/alsaspdif | |
parent | 14da2ceef57b29bafd0cb9ba0d37ebd5c1571587 (diff) | |
download | gst-plugins-bad-e8af48c02bbfe197d10386aa4b413c9d64bb6fc9.tar.gz gst-plugins-bad-e8af48c02bbfe197d10386aa4b413c9d64bb6fc9.tar.bz2 gst-plugins-bad-e8af48c02bbfe197d10386aa4b413c9d64bb6fc9.zip |
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.
Diffstat (limited to 'ext/alsaspdif')
-rw-r--r-- | ext/alsaspdif/alsaspdifsink.c | 28 |
1 files changed, 17 insertions, 11 deletions
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; } |