[pulseaudio-discuss] [PATCH] modules: Fix warning in rtp-recv

Tanu Kaskinen tanuk at iki.fi
Tue Oct 23 00:55:28 PDT 2012


On Mon, 2012-10-22 at 23:43 +0200, Peter Meerwald wrote:
> From: Peter Meerwald <p.meerwald at bct-electronic.com>
> 
>   modules/rtp/module-rtp-recv.c:462:8: warning: 'r' may be used uninitialized in this function [-Wuninitialized]
> 
> Signed-off-by: Peter Meerwald <p.meerwald at bct-electronic.com>
> ---
>  src/modules/rtp/module-rtp-recv.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/modules/rtp/module-rtp-recv.c b/src/modules/rtp/module-rtp-recv.c
> index 412f4c3..bbd79a4 100644
> --- a/src/modules/rtp/module-rtp-recv.c
> +++ b/src/modules/rtp/module-rtp-recv.c
> @@ -451,12 +451,15 @@ static int mcast_socket(const struct sockaddr* sa, socklen_t salen) {
>          mr4.imr_multiaddr = ((const struct sockaddr_in*) sa)->sin_addr;
>          r = setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mr4, sizeof(mr4));
>  #ifdef HAVE_IPV6
> -    } else {
> +    } else if (af == AF_INET6) {
>          struct ipv6_mreq mr6;
>          memset(&mr6, 0, sizeof(mr6));
>          mr6.ipv6mr_multiaddr = ((const struct sockaddr_in6*) sa)->sin6_addr;
>          r = setsockopt(fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mr6, sizeof(mr6));
>  #endif
> +    } else {
> +        pa_log("Failed to join mcast group");
> +        goto fail;

I think pa_assert_not_reached() could be used here.

-- 
Tanu



More information about the pulseaudio-discuss mailing list