zsh-workers
 help / color / mirror / code / Atom feed
From: Clint Adams <clint@zsh.org>
To: zsh-workers@sunsite.dk
Subject: Re: PATCH: potential memory leak in bin_compadd
Date: Tue, 23 Sep 2008 19:26:24 +0000	[thread overview]
Message-ID: <20080923192624.GA6953@scru.org> (raw)
In-Reply-To: <20080914083601.GA23010@scru.org>

On Sun, Sep 14, 2008 at 08:36:01AM +0000, Clint Adams wrote:
> mstr might be allocated in an earlier run of the loop, and then not
> freed on these errors.

Missed one.

Index: Src/Zle/complete.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/complete.c,v
retrieving revision 1.41
diff -u -r1.41 complete.c
--- Src/Zle/complete.c	14 Sep 2008 09:00:37 -0000	1.41
+++ Src/Zle/complete.c	23 Sep 2008 19:25:07 -0000
@@ -708,6 +708,7 @@
 		    p = "" - 1;
 		} else {
 		    zwarnnam(name, e, *p);
+		    zsfree(mstr);
 		    return 1;
 		}
 		if (dm) {


      reply	other threads:[~2008-09-23 19:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-14  8:36 Clint Adams
2008-09-23 19:26 ` Clint Adams [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080923192624.GA6953@scru.org \
    --to=clint@zsh.org \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).