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

Martin Storsjö martin
Fri Mar 5 10:21:08 CET 2010


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.

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

No problem, your suggestions are quite good actually. :-)

// Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Merge-all-error-handling-in-tcp_open-and-udp_open-to.patch
Type: text/x-diff
Size: 3282 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100305/0da3e05d/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Call-ff_network_close-if-tcp_open-udp_open-fails.patch
Type: text/x-diff
Size: 1126 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100305/0da3e05d/attachment-0001.patch>



More information about the ffmpeg-devel mailing list