[vlc-devel] commit: Fix memory leak (CID 92) ( Rémi Denis-Courmont )
rdenis at simphalempin.com
Mon Jun 2 15:40:49 CEST 2008
On Mon, 02 Jun 2008 12:49:23 +0300, Dominique Leuenberger
<dominique at leuenberger.net> wrote:
> Quoting git version control <git at videolan.org>:
>> vlc | branch: 0.8.6-bugfix | Rémi Denis-Courmont
>> <rdenis at simphalempin.com> | Sat May 31 23:19:32 2008 +0300|
>> + goto error;
> WOW! And I thought the times of 'goto' are over for good. I've seen
> that you can use it twice.. but is this sacrifice really worthy?
find linux-22.214.171.124/ -name '*.h' -o -name '*.c' | \
while read a ; do grep 'goto ' "$a"; done | wc -l
Should I suggest you change your operating system?
The use of goto for error handling is a common practice, which is IMHO a
hell of a lot better than replicating the same error paths over and over
again within a function. goto is also the only way to break out of
non-innermost for/while/switch blocks, let alone return.
More information about the vlc-devel