zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: memory leak in parsecomplist
@ 2008-11-06  2:56 Clint Adams
  2008-11-08  6:31 ` Clint Adams
  0 siblings, 1 reply; 2+ messages in thread
From: Clint Adams @ 2008-11-06  2:56 UTC (permalink / raw)
  To: zsh-workers

No point in allocating p1 if it's not going to be used.  CID 74.

Index: Src/glob.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/glob.c,v
retrieving revision 1.66
diff -u -r1.66 glob.c
--- Src/glob.c	29 Sep 2008 08:46:33 -0000	1.66
+++ Src/glob.c	6 Nov 2008 02:54:36 -0000
@@ -693,11 +693,13 @@
     if (*(str = instr) == Inpar && !skipparens(Inpar, Outpar, (char **)&str) &&
         *str == Pound && isset(EXTENDEDGLOB) && str[-2] == '/') {
 	instr++;
-	if (!(p1 = patcompile(instr, compflags, &instr)))
-	    return NULL;
+
 	if (instr[0] == '/' && instr[1] == Outpar && instr[2] == Pound) {
 	    int pdflag = 0;
 
+	    if (!(p1 = patcompile(instr, compflags, &instr)))
+	        return NULL;
+
 	    instr += 3;
 	    if (*instr == Pound) {
 		pdflag = 1;


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PATCH: memory leak in parsecomplist
  2008-11-06  2:56 PATCH: memory leak in parsecomplist Clint Adams
@ 2008-11-08  6:31 ` Clint Adams
  0 siblings, 0 replies; 2+ messages in thread
From: Clint Adams @ 2008-11-08  6:31 UTC (permalink / raw)
  To: zsh-workers

On Thu, Nov 06, 2008 at 02:56:55AM +0000, Clint Adams wrote:
> +	    if (!(p1 = patcompile(instr, compflags, &instr)))
> +	        return NULL;
> +

Reverting since I did this wrong.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-11-08  6:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-06  2:56 PATCH: memory leak in parsecomplist Clint Adams
2008-11-08  6:31 ` 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).