aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/rtpproto.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2014-10-18 16:58:41 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-10-20 10:47:29 +0100
commitd2771a1dc0a3695e8873adc16d068077f2417eea (patch)
tree558c85bc6b319bcff9211fb7052da67ce0ce9ba9 /libavformat/rtpproto.c
parent96bfb677478514db73d1b63b4213c97ad4269e8f (diff)
downloadffmpeg-d2771a1dc0a3695e8873adc16d068077f2417eea.tar.gz
rtpproto: Free the addrinfo pointer on failure
CC: libav-stable@libav.org Bug-Id: CID 1238797
Diffstat (limited to 'libavformat/rtpproto.c')
-rw-r--r--libavformat/rtpproto.c4
1 files changed, 3 insertions, 1 deletions
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);