From cee9aeaf6b6f88b3dd40df32f0e4833285909547 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 21 Oct 2015 18:53:34 +0200 Subject: ao_coreaudio: fix some minor memory leaks --- audio/out/ao_coreaudio.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'audio') diff --git a/audio/out/ao_coreaudio.c b/audio/out/ao_coreaudio.c index c592c0ef84..90aa672de6 100644 --- a/audio/out/ao_coreaudio.c +++ b/audio/out/ao_coreaudio.c @@ -180,6 +180,8 @@ static void init_physical_format(struct ao *ao) struct priv *p = ao->priv; OSErr err; + void *tmp = talloc_new(NULL); + AudioStreamBasicDescription asbd; ca_fill_asbd(ao, &asbd); @@ -190,6 +192,8 @@ static void init_physical_format(struct ao *ao) &streams, &n_streams); CHECK_CA_ERROR("could not get number of streams"); + talloc_steal(tmp, streams); + MP_VERBOSE(ao, "Found %zd substream(s).\n", n_streams); for (int i = 0; i < n_streams; i++) { @@ -204,6 +208,7 @@ static void init_physical_format(struct ao *ao) if (!CHECK_CA_WARN("could not get number of stream formats")) continue; // try next one + talloc_steal(tmp, formats); uint32_t direction; err = CA_GET(streams[i], kAudioStreamPropertyDirection, &direction); @@ -239,6 +244,7 @@ static void init_physical_format(struct ao *ao) } coreaudio_error: + talloc_free(tmp); return; } -- cgit v1.2.3