[vlc-devel] commit: Fix memory leak (CID 92) ( Rémi Denis-Courmont )

Remi 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|  
>> [bd6877f9e3e0738013521bc98fe6bd12697a59ce]
> 
>> +        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-2.6.25.4/ -name '*.h' -o -name '*.c' | \
while read a ; do grep 'goto ' "$a"; done | wc -l
51571

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.

-- 
Rémi Denis-Courmont
http://www.remlab.net




More information about the vlc-devel mailing list