[FFmpeg-cvslog] rtpproto: Free the addrinfo pointer on failure

Luca Barbato git at videolan.org
Mon Oct 20 23:16:07 CEST 2014


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Sat Oct 18 16:58:41 2014 +0100| [d2771a1dc0a3695e8873adc16d068077f2417eea] | committer: Vittorio Giovara

rtpproto: Free the addrinfo pointer on failure

CC: libav-stable at libav.org
Bug-Id: CID 1238797

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d2771a1dc0a3695e8873adc16d068077f2417eea
---

 libavformat/rtpproto.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/rtpproto.c b/libavformat/rtpproto.c
index 0f31539..d5ecfc8 100644
--- a/libavformat/rtpproto.c
+++ b/libavformat/rtpproto.c
@@ -231,8 +231,10 @@ static void rtp_parse_addr_list(URLContext *h, char *buf,
         ai = rtp_resolve_host(p, 0, SOCK_DGRAM, AF_UNSPEC, 0);
         if (ai) {
             source_addr = av_mallocz(sizeof(struct sockaddr_storage));
-            if (!source_addr)
+            if (!source_addr) {
+                freeaddrinfo(ai);
                 break;
+            }
 
             memcpy(source_addr, ai->ai_addr, ai->ai_addrlen);
             freeaddrinfo(ai);



More information about the ffmpeg-cvslog mailing list