From: Clint Adams <clint@zsh.org>
To: zsh-workers@sunsite.dk
Subject: PATCH: potential memory leak in getsubsargs
Date: Wed, 10 Sep 2008 18:57:24 +0000 [thread overview]
Message-ID: <20080910185724.GA26412@scru.org> (raw)
ptr2 gets allocated by hdynread2() above, but does not get used if
(!hsub1).
Index: Src/hist.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/hist.c,v
retrieving revision 1.82
diff -u -r1.82 hist.c
--- Src/hist.c 4 Sep 2008 22:27:59 -0000 1.82
+++ Src/hist.c 10 Sep 2008 18:53:22 -0000
@@ -346,8 +346,10 @@
if (strlen(ptr1)) {
zsfree(hsubl);
hsubl = ptr1;
- } else if (!hsubl) /* fail silently on this */
+ } else if (!hsubl) { /* fail silently on this */
+ zsfree(ptr2);
return 0;
+ }
zsfree(hsubr);
hsubr = ptr2;
follow = ingetc();
reply other threads:[~2008-09-10 18:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20080910185724.GA26412@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).