[FFmpeg-cvslog] flvdec: Eliminate completely silly goto
Thilo Borgmann
thilo.borgmann at mail.de
Sun Aug 11 12:15:58 CEST 2013
Am 11.08.13 11:39, schrieb Reimar Döffinger:
> On Sun, Aug 11, 2013 at 11:34:57AM +0200, Thilo Borgmann wrote:
>> Am 11.08.13 02:02, schrieb Alexander Strasser:
>>> On 2013-08-02 12:23 +0200, Diego Biurrun wrote:
>>>> ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Wed Jul 31
>>>> 23:56:26 2013 +0200| [f900f35ac8db4ac30df6fda1c27502c2ef9e6ba5] |
>>>> committer: Diego Biurrun
>>>>
>>>> flvdec: Eliminate completely silly goto
>>>
>>> Right away, I am a big fan of Dijkstra. Really!
>>
>> I'm neither a fan of Dijkstra nor Diego. However, I don't see the issue with
>> this patch except for loosing one pair of {} braces. Please elaborate.
>
> Simple: If someone adds a malloc they'll either add back the goto (making
> this patch useless history clutter) or even more likely they'll forget
> to add the free in half the cases, causing a memleak we won't detect
> since we don't properly test error cases.
Fair enough, thanks for clarification.
However, I often encounter the problem of redundant
"if (ret == bad) {free(); free(); return;}"
blocks in functions and would not have guessed that such a goto would be a good
way to handle it.
-Thilo
More information about the ffmpeg-cvslog
mailing list