[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 1/4] Fix memory leaks in MDNS code



On 07/25/2011 01:03 PM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange"<berrange redhat com>

* src/rpc/virnetservermdns.c: Fix leaks
---
  src/rpc/virnetservermdns.c |    3 +++
  1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/rpc/virnetservermdns.c b/src/rpc/virnetservermdns.c
index ff2d92d..335274a 100644
--- a/src/rpc/virnetservermdns.c
+++ b/src/rpc/virnetservermdns.c
@@ -583,6 +583,7 @@ void virNetServerMDNSFree(virNetServerMDNSPtr mdns)
          group = tmp;
      }

+    VIR_FREE(mdns->poller);
      VIR_FREE(mdns);
  }


Could virNetServeMDNSFree() ever be called while mdns->client is still valid? (i.e. without calling virNetServerMDNSStop())


ACK, assuming the answer to that is No. (Otherwise maybe this function should call virNetServerMDNSStop().



@@ -601,6 +602,7 @@ void virNetServerMDNSGroupFree(virNetServerMDNSGroupPtr grp)
          entry = tmp;
      }

+    VIR_FREE(grp->name);
      VIR_FREE(grp);
  }

@@ -610,5 +612,6 @@ void virNetServerMDNSEntryFree(virNetServerMDNSEntryPtr entry)
      if (!entry)
          return;

+    VIR_FREE(entry->type);
      VIR_FREE(entry);
  }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]