From patchwork Fri Nov 15 17:06:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlad Yasevich X-Patchwork-Id: 291627 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1C9762C0098 for ; Sat, 16 Nov 2013 04:07:32 +1100 (EST) Received: from localhost ([::1]:33048 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VhMrh-0003xf-Hx for incoming@patchwork.ozlabs.org; Fri, 15 Nov 2013 12:07:29 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42771) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VhMrK-0003ot-To for qemu-devel@nongnu.org; Fri, 15 Nov 2013 12:07:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VhMrE-0006FR-Vw for qemu-devel@nongnu.org; Fri, 15 Nov 2013 12:07:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58113) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VhMrE-0006FD-Jj for qemu-devel@nongnu.org; Fri, 15 Nov 2013 12:07:00 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rAFH6xab026905 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 15 Nov 2013 12:07:00 -0500 Received: from vyasevic.redhat.com (ovpn-113-83.phx2.redhat.com [10.3.113.83]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rAFH6x9M025059; Fri, 15 Nov 2013 12:06:59 -0500 From: Vlad Yasevich To: qemu-devel@nongnu.org Date: Fri, 15 Nov 2013 12:06:56 -0500 Message-Id: <1384535216-6171-1-git-send-email-vyasevic@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Vlad Yasevich Subject: [Qemu-devel] [PATCH] qom: Fix memory leak in object_property_set_link() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Save the result of the call to object_get_cannonical_path() so we can free it. Signed-off-by: Vlad Yasevich --- qom/object.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qom/object.c b/qom/object.c index b617f26..21b6f87 100644 --- a/qom/object.c +++ b/qom/object.c @@ -838,8 +838,9 @@ char *object_property_get_str(Object *obj, const char *name, void object_property_set_link(Object *obj, Object *value, const char *name, Error **errp) { - object_property_set_str(obj, object_get_canonical_path(value), - name, errp); + gchar *path = object_get_cannonical_path(value); + object_property_set_str(obj, path, name, errp); + gfree(path); } Object *object_property_get_link(Object *obj, const char *name,