From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEPYE-0003gr-7U for qemu-devel@nongnu.org; Mon, 04 Aug 2014 17:12:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEPY8-0003s5-3E for qemu-devel@nongnu.org; Mon, 04 Aug 2014 17:12:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22594) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEPY7-0003rw-SJ for qemu-devel@nongnu.org; Mon, 04 Aug 2014 17:12:08 -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 s74LC7Cw003803 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 4 Aug 2014 17:12:07 -0400 From: John Snow Date: Mon, 4 Aug 2014 17:11:22 -0400 Message-Id: <1407186691-16103-22-git-send-email-jsnow@redhat.com> In-Reply-To: <1407186691-16103-1-git-send-email-jsnow@redhat.com> References: <1407186691-16103-1-git-send-email-jsnow@redhat.com> Subject: [Qemu-devel] [PATCH v2 21/30] libqtest: Correct small memory leak. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, jsnow@redhat.com, stefanha@redhat.com, mst@redhat.com 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 --- 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) -- 1.9.3