From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYb7O-0004a4-Np for qemu-devel@nongnu.org; Mon, 29 Sep 2014 09:36:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XYb7J-0003ru-Qy for qemu-devel@nongnu.org; Mon, 29 Sep 2014 09:35:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39125) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYb7J-0003qb-4J for qemu-devel@nongnu.org; Mon, 29 Sep 2014 09:35:53 -0400 Message-ID: <5429601E.3070207@redhat.com> Date: Mon, 29 Sep 2014 15:35:26 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1411794841-9672-1-git-send-email-arei.gonglei@huawei.com> <1411794841-9672-5-git-send-email-arei.gonglei@huawei.com> In-Reply-To: <1411794841-9672-5-git-send-email-arei.gonglei@huawei.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 4/7] qom: add description field in ObjectProperty struct List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: arei.gonglei@huawei.com, qemu-devel@nongnu.org Cc: weidong.huang@huawei.com, aliguori@amazon.com, mst@redhat.com, armbru@redhat.com, luonengjun@huawei.com, peter.huangpeng@huawei.com, lcapitulino@redhat.com, stefanha@redhat.com, afaerber@suse.de Il 27/09/2014 07:13, arei.gonglei@huawei.com ha scritto: > +void object_property_set_description(Object *obj, const char *name, > + const char *description, Error **errp) > +{ > + ObjectProperty *op; > + > + op = object_property_find(obj, name, errp); > + if (!op) { > + return; > + } The old description is leaked here if it is not NULL. Since you are doing v4, please move the object_property_add_alias change here, too. Paolo > + op->description = description ? g_strdup(description) : NULL; > +} > +