summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArun Raghavan <arun.raghavan@collabora.co.uk>2011-03-02 11:16:48 +0530
committerArun Raghavan <arun.raghavan@collabora.co.uk>2011-05-02 11:54:48 +0530
commit8b3e68a202084467086af6c83e89c07adb9aa18a (patch)
treec0c5e961141f9061e2c606006c1cd4468d37e058
parente418e49ecbd643f3cac87438d00baaf86275927c (diff)
sink: Fix leak in pa_sink_check_formats()
We weren't freeing the sink formats idxset.
-rw-r--r--src/pulsecore/sink.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index 33923e1f..2b9402ab 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -3295,7 +3295,7 @@ pa_idxset* pa_sink_get_formats(pa_sink *s) {
/* Calculates the intersection between formats supported by the sink and
* in_formats, and returns these, in the order of the sink's formats. */
pa_idxset* pa_sink_check_formats(pa_sink *s, pa_idxset *in_formats) {
- pa_idxset *out_formats = pa_idxset_new(NULL, NULL), *sink_formats;
+ pa_idxset *out_formats = pa_idxset_new(NULL, NULL), *sink_formats = NULL;
pa_format_info *f_sink, *f_in;
uint32_t i, j;
@@ -3314,5 +3314,8 @@ pa_idxset* pa_sink_check_formats(pa_sink *s, pa_idxset *in_formats) {
}
done:
+ if (sink_formats)
+ pa_idxset_free(sink_formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
+
return out_formats;
}