From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4091 invoked by alias); 20 Aug 2007 17:03:16 -0000 Received: (qmail 4000 invoked by uid 22791); 20 Aug 2007 17:03:14 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 20 Aug 2007 17:03:07 +0000 Received: (qmail 24621 invoked from network); 20 Aug 2007 17:03:05 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 20 Aug 2007 17:03:05 -0000 To: chet.ramey@case.edu Cc: msnyder@sonic.net, bug-readline@gnu.org, gdb-patches@sourceware.org, chet@case.edu Subject: Re: [Bug-readline] Re: PATCH: readline/histexpand.c, resource leak References: <10015.12.7.175.2.1185934493.squirrel@webmail.sonic.net> <46C7528D.2000002@case.edu> From: Jim Blandy Date: Mon, 20 Aug 2007 17:03:00 -0000 In-Reply-To: <46C7528D.2000002@case.edu> (Chet Ramey's message of "Sat, 18 Aug 2007 16:11:57 -0400") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-08/txt/msg00397.txt.bz2 Chet Ramey writes: > Jim Blandy wrote: >> It seems to me that 'words' is a malloc'ed array of malloc'ed strings, >> so 'free (words)' still leaks storage. > > I don't believe there's a case where wind == -1 and any malloced strings > exist in words[]. There's no leak unless that can happen. Not even if history_tokenize_internal's 'windp' argument falls in whitespace between words?