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

Martin Storsjö martin
Fri Mar 5 23:43:02 CET 2010


On Fri, 5 Mar 2010, Martin Storsj? wrote:

> On Thu, 4 Mar 2010, Ronald S. Bultje wrote:
> 
> > 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.
> 
> Good idea, that makes all of this a bit cleaner I think. New attempt 
> attached.

This is no longer needed now that network initialization is handled in 
url_open_protocol.

// Martin



More information about the ffmpeg-devel mailing list