[libvirt] [PATCH for 1.2.8] conf: fix leak by freeing def->mem.hugepages

Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- src/conf/domain_conf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 3b295ab..d6fd1ab 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2136,6 +2136,8 @@ void virDomainDefFree(virDomainDefPtr def) virDomainMemballoonDefFree(def->memballoon); virDomainNVRAMDefFree(def->nvram); + VIR_FREE(def->mem.hugepages); + for (i = 0; i < def->nseclabels; i++) virSecurityLabelDefFree(def->seclabels[i]); VIR_FREE(def->seclabels); -- 2.1.0

Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- src/conf/domain_conf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 3b295ab..91f92a4 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2136,6 +2136,10 @@ void virDomainDefFree(virDomainDefPtr def) virDomainMemballoonDefFree(def->memballoon); virDomainNVRAMDefFree(def->nvram); + for (i = 0; i < def->mem.nhugepages; i++) + virBitmapFree(def->mem.hugepages[i].nodemask); + VIR_FREE(def->mem.hugepages); + for (i = 0; i < def->nseclabels; i++) virSecurityLabelDefFree(def->seclabels[i]); VIR_FREE(def->seclabels); -- 2.1.0
participants (2)
-
Ján Tomko
-
Martin Kletzander