diff options
author | wm4 <wm4@nowhere> | 2015-10-21 18:53:34 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-10-21 18:53:34 +0200 |
commit | cee9aeaf6b6f88b3dd40df32f0e4833285909547 (patch) | |
tree | 4ebf70e42082db38aee733c2ffd190ab339f1e1a /audio | |
parent | eb66038d4ff9dd2faadd317d8eb777ebbaa9687f (diff) |
ao_coreaudio: fix some minor memory leaks
Diffstat (limited to 'audio')
-rw-r--r-- | audio/out/ao_coreaudio.c | 6 |
1 files changed, 6 insertions, 0 deletions
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; } |