Skip to contentSkip to conversation

fix xentop memory leak

PATCH New Atsushi SAKAI 1 participant 1 message Apr 2, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix xentop memory leak

This patch fixes xentop memory leak.

I try to use valgrind on x86 with followin options valgrind --leak-check=full --show-reachable=yes xentop
I found following message.(see item "definitely lost"). With this patch, it fixes the error message value(bytes and blocks) goes to 0.

==31232==
==31232== 12 bytes in 3 blocks are definitely lost in loss record 2 of 11
==31232== at 0x40224E5: malloc (vg_replace_malloc.c:149)
==31232== by 0x804A326: top (xentop.c:957)
==31232==
==31232== LEAK SUMMARY:
==31232== definitely lost: 12 bytes in 3 blocks.
==31232== possibly lost: 0 bytes in 0 blocks.
==31232== still reachable: 5,534 bytes in 15 blocks.
==31232== suppressed: 0 bytes in 0 blocks.
==31232== Reachable blocks (those to which a pointer was found) are not shown. ==31232== To see them, rerun with: --leak-check=full --show-reachable=yes

Thanks
Atsushi SAKAI

tools/xenstat/xentop/xentop.c +2 -0
diff -r fc9e2f7920c9 tools/xenstat/xentop/xentop.c
@@ -984,6 +984,8 @@ static void top(void)
 
 	if(!batch)
 	do_bottom_line();
+
+	free(domains);
 }
 
 int main(int argc, char **argv)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel