From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGKhA-0003nu-4R for qemu-devel@nongnu.org; Tue, 18 Oct 2011 21:11:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RGKh8-0008U8-SK for qemu-devel@nongnu.org; Tue, 18 Oct 2011 21:11:48 -0400 Received: from auth.b.painless.aaisp.net.uk ([90.155.4.48]:53340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGKUu-0006kG-U4 for qemu-devel@nongnu.org; Tue, 18 Oct 2011 20:59:09 -0400 Date: Wed, 19 Oct 2011 01:59:04 +0100 From: Stuart Brady Message-ID: <20111019005904.GA26395@zubnet.me.uk> References: <1318881685-23983-1-git-send-email-sw@weilnetz.de> <20111018011349.GA13280@zubnet.me.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH] gdbstub: Fix memory leak List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel@nongnu.org On Tue, Oct 18, 2011 at 06:18:11PM +0000, Blue Swirl wrote: > Cool. Please include the spatch with the commit message. Thanks, will do! FWIW, it results in: 51 files changed, 99 insertions(+), 136 deletions(-) I wonder if that needs splitting up at all? > IIRC I had also problems with identifiers, I could not get checking > identifiers against CODING_STYLE to work. FWIW, I got there in the end: @@ type T; T *E; @@ -E = g_malloc(sizeof(*E)) +E = g_new(T, 1) @@ type T; T *E; @@ -E = g_malloc0(sizeof(*E)) +E = g_new0(T, 1) @@ type T; T *E; expression N; @@ -E = g_malloc(sizeof(*E) * N) +E = g_new(T, N) @@ type T; T *E; expression N; @@ -E = g_malloc0(sizeof(*E) * N) +E = g_new0(T, N) @@ type T; T *E; @@ -E = g_malloc(sizeof(T)) +E = g_new(T, 1) @@ type T; T *E; @@ -E = g_malloc0(sizeof(T)) +E = g_new0(T, 1) @@ type T; T *E; expression N; @@ -E = g_malloc(sizeof(T) * N) +E = g_new(T, N) @@ type T; T *E; expression N; @@ -E = g_malloc0(sizeof(T) * N) +E = g_new0(T, N) With this added, I get: 246 files changed, 514 insertions(+), 557 deletions(-) That includes the original 99 insertions and 136 deletions. I think I should at least submit the patch to convert cases involving casts as the first part of the patch series, and convert the sizeof(*E) and sizeof(T) cases as the second and third parts. Sound okay? Cheers, -- Stuart Brady