From: David S. Miller Date: Mon, 3 Oct 2005 21:21:58 +0000 (-0700) Subject: [IPV6]: Fix leak added by udp connect dst caching fix. X-Git-Tag: v2.6.14-rc4~75 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5e7c210fefd2454c757a3542e41063407ca7108;p=linux-2.6 [IPV6]: Fix leak added by udp connect dst caching fix. Based upon a patch from Mitsuru KANDA Signed-off-by: David S. Miller --- diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 6001948600..e4cad11f28 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -852,10 +852,16 @@ do_append_data: else if (!corkreq) err = udp_v6_push_pending_frames(sk, up); - if (dst && connected) - ip6_dst_store(sk, dst, - ipv6_addr_equal(&fl->fl6_dst, &np->daddr) ? - &np->daddr : NULL); + if (dst) { + if (connected) { + ip6_dst_store(sk, dst, + ipv6_addr_equal(&fl->fl6_dst, &np->daddr) ? + &np->daddr : NULL); + } else { + dst_release(dst); + } + } + if (err > 0) err = np->recverr ? net_xmit_errno(err) : 0; release_sock(sk);