From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11142 invoked by alias); 3 Oct 2005 14:40:26 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 11135 invoked by uid 22791); 3 Oct 2005 14:40:25 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 03 Oct 2005 14:40:25 +0000 Received: from drow by nevyn.them.org with local (Exim 4.52) id 1EMRUM-0005ZR-Qy; Mon, 03 Oct 2005 10:40:22 -0400 Date: Mon, 03 Oct 2005 14:40:00 -0000 From: Daniel Jacobowitz To: Kris Warkentin Cc: gdb-patches@sources.redhat.com Subject: Re: [patch] clean up potential memory leak in thread.c Message-ID: <20051003144022.GA21326@nevyn.them.org> Mail-Followup-To: Kris Warkentin , gdb-patches@sources.redhat.com References: <433C21F1.9000903@qnx.com> <20051002201953.GA31820@nevyn.them.org> <43414074.3010506@qnx.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43414074.3010506@qnx.com> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-10/txt/msg00020.txt.bz2 On Mon, Oct 03, 2005 at 10:30:12AM -0400, Kris Warkentin wrote: > We're throwing named thread support into the kernel so I'm keeping an > arbitrary length string in there. Would never be a huge memory leak but > I'm fussy that way. You don't actually need this to add an arbitrary lenth string; the target gets to malloc this, you can use a trailing char[1] or simply malloc sizeof(struct) + strlen (char) + 1 and point the char* right after the struct. If it's clearer to do it this way, though, we can go with your patch. If you'd rather do that let me know; IIRC there were some formatting glitches. -- Daniel Jacobowitz CodeSourcery, LLC