Bug 83959 - ca_sound_file_open forgets to call fclose() on failure
Summary: ca_sound_file_open forgets to call fclose() on failure
Status: NEW
Alias: None
Product: libcanberra
Classification: Unclassified
Component: Unspecified (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: Lennart Poettering
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-17 02:06 UTC by Matthew Gregan [:kinetik]
Modified: 2014-09-17 02:07 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
trivial fix (312 bytes, patch)
2014-09-17 02:07 UTC, Matthew Gregan [:kinetik]
Details | Splinter Review

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.