Revision 7ad526d2

View differences:

libavformat/sdp.c
82 82
static void resolve_destination(char *dest_addr, int size, char *type,
83 83
                                int type_size)
84 84
{
85
    struct addrinfo hints, *ai, *cur;
85
    struct addrinfo hints, *ai;
86 86

  
87 87
    av_strlcpy(type, "IP4", type_size);
88 88
    if (!dest_addr[0])
......
94 94
    memset(&hints, 0, sizeof(hints));
95 95
    if (getaddrinfo(dest_addr, NULL, &hints, &ai))
96 96
        return;
97
    for (cur = ai; cur; cur = cur->ai_next) {
98
        getnameinfo(cur->ai_addr, cur->ai_addrlen, dest_addr, size,
97
        getnameinfo(ai->ai_addr, ai->ai_addrlen, dest_addr, size,
99 98
                    NULL, 0, NI_NUMERICHOST);
100
        if (cur->ai_family == AF_INET6)
99
        if (ai->ai_family == AF_INET6)
101 100
            av_strlcpy(type, "IP6", type_size);
102
        break;
103
    }
104 101
    freeaddrinfo(ai);
105 102
}
106 103
#else

Also available in: Unified diff