aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenstat
diff options
context:
space:
mode:
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>2005-10-30 13:23:21 +0100
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>2005-10-30 13:23:21 +0100
commit896ca6d77a31449b0d7f120cf74e122d9244ab88 (patch)
treea64ae5914c34be41f49dc9302406bdb6a53284f3 /tools/xenstat
parent8c48c9e2ad06aa8d2d5faee7fe5c52a4a82a3df5 (diff)
downloadxen-896ca6d77a31449b0d7f120cf74e122d9244ab88.tar.gz
xen-896ca6d77a31449b0d7f120cf74e122d9244ab88.tar.bz2
xen-896ca6d77a31449b0d7f120cf74e122d9244ab88.zip
Free domain names in xenstat_free_node, fixing small memory leak.
Thanks to Anthony Liguori for spotting the leak. Signed-off-by: Ewan Mellor <ewan@xensource.com>
Diffstat (limited to 'tools/xenstat')
-rw-r--r--tools/xenstat/libxenstat/src/xenstat.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/xenstat/libxenstat/src/xenstat.c b/tools/xenstat/libxenstat/src/xenstat.c
index 22a3ec8a97..0e29cacb4f 100644
--- a/tools/xenstat/libxenstat/src/xenstat.c
+++ b/tools/xenstat/libxenstat/src/xenstat.c
@@ -284,6 +284,11 @@ void xenstat_free_node(xenstat_node * node)
if (node) {
if (node->domains) {
+ for (i = 0; i < node->num_domains; i++) {
+ if (node->domains[i].name)
+ free(node->domains[i].name);
+ }
+
for (i = 0; i < NUM_COLLECTORS; i++)
if((node->flags & collectors[i].flag)
== collectors[i].flag)