+2004-04-30 Colin Walters <walters@verbum.org>
+
+ * ext/alsa/gstalsasink.c (gst_alsa_sink_mmap): Plug a memleak.
+
2004-04-30 Thomas Vander Stichele <thomas at apestaart dot org>
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
const snd_pcm_channel_area_t *dst;
snd_pcm_channel_area_t *src;
GstAlsaSink *sink = GST_ALSA_SINK (this);
- int i, err, width = snd_pcm_format_physical_width (this->format->format);
+ int i;
+ int err = -1;
+ int width = snd_pcm_format_physical_width (this->format->format);
/* areas points to the memory areas that belong to gstreamer. */
src = g_malloc0 (this->format->channels * sizeof (snd_pcm_channel_area_t));
if ((err = snd_pcm_mmap_begin (this->handle, &dst, &offset, avail)) < 0) {
GST_ERROR_OBJECT (this, "mmap failed: %s", snd_strerror (err));
- return -1;
+ goto out;
}
if ((err =
*avail, this->format->format)) < 0) {
snd_pcm_mmap_commit (this->handle, offset, 0);
GST_ERROR_OBJECT (this, "data copy failed: %s", snd_strerror (err));
- return -1;
+ goto out;
}
if ((err = snd_pcm_mmap_commit (this->handle, offset, *avail)) < 0) {
GST_ERROR_OBJECT (this, "mmap commit failed: %s", snd_strerror (err));
- return -1;
+ goto out;
}
+ out:
+ g_free (src);
return err;
}
static int