WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 3 of 3] xl: don't leak uuid string on xl list

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 3 of 3] xl: don't leak uuid string on xl list
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Fri, 13 Aug 2010 15:30:10 +0100
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Fri, 13 Aug 2010 07:31:37 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1281709807@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1281709714 -3600
# Node ID 0a55168059b6c875d5923fd56d908db4636f4a74
# Parent  cf21a4ad0e798f76adb91453769a36e0856ccd12
xl: don't leak uuid string on xl list

==10272== 37 bytes in 1 blocks are definitely lost in loss record 1 of 1
==10272==    at 0x4022F0A: malloc (vg_replace_malloc.c:236)
==10272==    by 0x4047B2B: libxl_uuid2string (libxl_dom.c:457)
==10272==    by 0x8050A02: list_domains (xl_cmdimpl.c:2198)
==10272==    by 0x8054FC5: main_list (xl_cmdimpl.c:3064)
==10272==    by 0x804B5AB: main (xl.c:76)

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r cf21a4ad0e79 -r 0a55168059b6 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Fri Aug 13 15:25:09 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c  Fri Aug 13 15:28:34 2010 +0100
@@ -2197,6 +2197,7 @@ void list_domains(int verbose, const lib
         if (verbose) {
             char *uuid = libxl_uuid2string(&ctx, info[i].uuid);
             printf(" %s", uuid);
+            free(uuid);
         }
         putchar('\n');
     }

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel