From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3723 invoked from network); 5 Mar 2003 14:00:00 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 5 Mar 2003 14:00:00 -0000 Received: (qmail 16698 invoked by alias); 5 Mar 2003 13:59:43 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18318 Received: (qmail 16687 invoked from network); 5 Mar 2003 13:59:43 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 5 Mar 2003 13:59:42 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [62.189.183.235] by sunsite.dk (MessageWall 1.0.8) with SMTP; 5 Mar 2003 13:59:42 -0000 Received: from exchange01.csr.com (unverified) by (Content Technologies SMTPRS 4.2.1) with ESMTP id for ; Wed, 5 Mar 2003 14:07:02 +0000 Received: from csr.com (tinky-winky.csr.com [192.168.144.127]) by exchange01.csr.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id DQ47PLXJ; Wed, 5 Mar 2003 13:59:38 -0000 To: zsh-workers@sunsite.dk Subject: Re: Memory leaks found by valgrind In-reply-to: "Felix Rosencrantz"'s message of "Fri, 28 Feb 2003 14:07:22 PST." <20030228220722.16160.qmail@web10406.mail.yahoo.com> Date: Wed, 05 Mar 2003 13:59:40 +0000 Message-ID: <1856.1046872780@csr.com> From: Peter Stephenson Felix Rosencrantz wrote: > The only new leak I found was the following. This I believe is related > to replace-string command. When I tried that widget, I would get more > leaks. (I haven't tried using other recent features/changes.) > 62 bytes in 62 blocks are definitely lost in loss record 5 of 13 > at 0x40165A60: malloc (vg_clientfuncs.c:100) > by 0x8086275: zalloc (mem.c:490) > by 0x810536C: set_prepost (zle_params.c:485) > by 0x810541E: set_postdisplay (zle_params.c:515) > by 0x808F7F4: setstrvalue (params.c:1608) > by 0x8090BAC: assignsparam (params.c:1994) > by 0x805F0A6: addvars (exec.c:1598) > by 0x805CDC9: execsimple (exec.c:756) This could be the following, which needs patching anyway. Index: Src/Zle/zle_params.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_params.c,v retrieving revision 1.8 diff -u -r1.8 zle_params.c --- Src/Zle/zle_params.c 27 Jan 2003 14:55:02 -0000 1.8 +++ Src/Zle/zle_params.c 5 Mar 2003 13:58:09 -0000 @@ -482,8 +482,10 @@ } if (x) { unmetafy(x, lenvar); - *textvar = (unsigned char *)zalloc(*lenvar); - memcpy((char *)*textvar, x, *lenvar); + if (*lenvar) { + *textvar = (unsigned char *)zalloc(*lenvar); + memcpy((char *)*textvar, x, *lenvar); + } free(x); } } -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070 ********************************************************************** The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. **********************************************************************