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] Re: Xenstored: eliminate double free and fixes for memory le

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Re: Xenstored: eliminate double free and fixes for memory leak
From: "Peter Teoh" <htmldeveloper@xxxxxxxxx>
Date: Mon, 17 Sep 2007 13:48:08 +0800
Delivery-date: Sun, 16 Sep 2007 22:48:50 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=B13wMW2ZbFu1j+HwNdR913D4tf5v0IlE1VecPzgmkRA=; b=OLkYOU+lVsqd4CaWH5a0e5O+SFeRBcBmwGeikKaDLkc3gxfOlCBq8PfxaMwrmSfvwIIZXO6Fq2v2kVlecXrVl9OWW0QeIFEPqoL0qENGq/IsUpYDrTRaT4nZpCpfy+tUvuB0jJtkS3Q3tuM5wmyjIIfJB3UBlgVZTVLkmbyimtc=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=GurpdTBpQqTkV23T1Bs8M2ubBp2UYmoYDvQ48WoO06ZUTkngUXUJPhUa55VNBjvlQtLhDxOEpkuj/kGn+zwwz03Ufgu8R1Tj3ci22VYlWk5L1UC9eK+4lr7t+OcqCIa44Jft972OtgO2pCDJK6ISe8/zvSoNGCVdC9fJyPD7Ywg=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <804dabb00709161919n6eb52d5apcb3aaff5f20e42bc@xxxxxxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <804dabb00709161919n6eb52d5apcb3aaff5f20e42bc@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
The changes are too interdependent, and therefore, I am now
resubmitting it as a complete patch, instead of splitting it up into
multiple patches.   All goes to the same file - xenstored_core.c.

On top of the comments given above, here are the additional comments:

Two FIXME comments added - for which a problem has been identified,
but fixing it will incurred a lot of changes in design etc.

First problem is the returned value from get_parent() - it can be
either a static value, or a dynamically allocated value (from
talloc_asprintf()), and therefore it is very difficult to judge
whether to free the memory or not.

Second (minor) problem is during destroy_node(), the allocated memory
within the node structure is not free.   These are allocated in
construct_node() function.

Please comments, thanks.

Attachment: eliminate_double_free_and_mem_leak.patch
Description: Text Data

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