zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: potential memory leak in getsubsargs
@ 2008-09-10 18:57 Clint Adams
  0 siblings, 0 replies; only message in thread
From: Clint Adams @ 2008-09-10 18:57 UTC (permalink / raw)
  To: zsh-workers

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();


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-09-10 18:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-10 18:57 PATCH: potential memory leak in getsubsargs Clint Adams

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).