From d2771a1dc0a3695e8873adc16d068077f2417eea Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Sat, 18 Oct 2014 16:58:41 +0100 Subject: rtpproto: Free the addrinfo pointer on failure CC: libav-stable@libav.org Bug-Id: CID 1238797 --- libavformat/rtpproto.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libavformat') diff --git a/libavformat/rtpproto.c b/libavformat/rtpproto.c index 0f31539ebe..d5ecfc8898 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); -- cgit v1.2.3