From e7c87f757c9dbf2492c22f8b5a4c9700e126af31 Mon Sep 17 00:00:00 2001 From: Zhang Huan Date: Mon, 23 Jul 2018 16:07:59 +0800 Subject: rpc: add missing free of rpc->dnscache Change-Id: I3fa97b99bf23459cf548205d75d2cc7936b2310e fixes: bz#1607689 Signed-off-by: Zhang Huan --- rpc/rpc-lib/src/rpc-transport.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'rpc/rpc-lib/src') diff --git a/rpc/rpc-lib/src/rpc-transport.c b/rpc/rpc-lib/src/rpc-transport.c index 946e65b879c..40a40faee10 100644 --- a/rpc/rpc-lib/src/rpc-transport.c +++ b/rpc/rpc-lib/src/rpc-transport.c @@ -458,6 +458,7 @@ fail: int32_t rpc_transport_destroy (rpc_transport_t *this) { + struct dnscache6 *cache = NULL; int32_t ret = -1; GF_VALIDATE_OR_GOTO("rpc_transport", this, fail); @@ -480,6 +481,13 @@ rpc_transport_destroy (rpc_transport_t *this) GF_FREE(this->ssl_name); } + if (this->dnscache) { + cache = this->dnscache; + if (cache->first) + freeaddrinfo (cache->first); + GF_FREE (this->dnscache); + } + GF_FREE (this); fail: return ret; -- cgit