[FFmpeg-devel] [PATCH] Make sure ff_network_close is called if protocol open functions fail

Ronald S. Bultje rsbultje
Thu Mar 4 23:48:08 CET 2010


Hi,

On Thu, Mar 4, 2010 at 5:26 PM, Martin Storsj? <martin at martin.st> wrote:
> Currently, a failure in the tcp_open/udp_open functions will "leak" one
> ff_network_init call. The attached patch makes sure to clean up this
> properly in all (hopefully?) codepaths.

I think all these seem like perfect opportunities to merge the error
handling with the goto fail path (might require an if (ai) before the
freeaddrinfo(ai), and an ai = NULL; at the top). Not because it'd
decrease code size (it wouldn't, I think), but because it would keep
code size equal but future initializations would keep code size and
patch size smaller, I think.

Sorry if I'm being a pain today. :-).

Ronald



More information about the ffmpeg-devel mailing list