Bug 83959

Summary: ca_sound_file_open forgets to call fclose() on failure
Product: libcanberra Reporter: Matthew Gregan [:kinetik] <kinetik>
Component: UnspecifiedAssignee: Lennart Poettering <lennart>
Status: NEW --- QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: trivial fix

Description Matthew Gregan [:kinetik] 2014-09-17 02:06:56 UTC
This was originally reported against Firefox, original bug here: https://bugzilla.mozilla.org/show_bug.cgi?id=1066453

ca_sound_file_open calls fopen() on the supplied path, then hands ownership of the FILE* to the wav or vorbis file reader.  ca_wav_close and ca_vorbis_close (via ov_clear) correctly fclose() the FILE*.

On error, e.g. when attempting to play an unsupported file format, ca_sound_file_open forgets to fclose() the FILE*.
Comment 1 Matthew Gregan [:kinetik] 2014-09-17 02:07:43 UTC
Created attachment 106401 [details] [review]
trivial fix

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.