From patchwork Fri Aug 15 17:06:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 380360 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B4A4814007B for ; Sat, 16 Aug 2014 03:19:36 +1000 (EST) Received: from localhost ([::1]:60720 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XILA6-0001w2-Fc for incoming@patchwork.ozlabs.org; Fri, 15 Aug 2014 13:19:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIKyr-0006I2-Gq for qemu-devel@nongnu.org; Fri, 15 Aug 2014 13:08:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XIKyl-0000HS-BH for qemu-devel@nongnu.org; Fri, 15 Aug 2014 13:07:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39809) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIKyl-0000HL-2r for qemu-devel@nongnu.org; Fri, 15 Aug 2014 13:07:51 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7FH7ms5011480 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Aug 2014 13:07:48 -0400 Received: from localhost (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s7FH7lvM022699; Fri, 15 Aug 2014 13:07:48 -0400 From: Stefan Hajnoczi To: Date: Fri, 15 Aug 2014 18:06:28 +0100 Message-Id: <1408122422-13935-22-git-send-email-stefanha@redhat.com> In-Reply-To: <1408122422-13935-1-git-send-email-stefanha@redhat.com> References: <1408122422-13935-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Peter Maydell , John Snow , Stefan Hajnoczi Subject: [Qemu-devel] [PULL 21/55] libqtest: Correct small memory leak. 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 From: John Snow Fixes a small memory leak inside of libqtest. After we produce a test path and glib copies the string for itself, we should clean up our temporary copy. Signed-off-by: John Snow Signed-off-by: Stefan Hajnoczi --- tests/libqtest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/libqtest.c b/tests/libqtest.c index e525e6f..0bf17aa 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -644,6 +644,7 @@ void qtest_add_func(const char *str, void (*fn)) { gchar *path = g_strdup_printf("/%s/%s", qtest_get_arch(), str); g_test_add_func(path, fn); + g_free(path); } void qtest_memwrite(QTestState *s, uint64_t addr, const void *data, size_t size)