zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: bindkey resource leak
@ 2008-11-11 16:31 Oliver Kiddle
  0 siblings, 0 replies; only message in thread
From: Oliver Kiddle @ 2008-11-11 16:31 UTC (permalink / raw)
  To: Zsh workers

Either of these run repeatedly will increment the reference counter for
the "thingy". The first case is CID 107. I don't think coverity picked
up on the second case.

bindkey -R B-A thingy
bindkey '' thingy

Oliver

Index: Src/Zle/zle_keymap.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_keymap.c,v
retrieving revision 1.29
diff -u -r1.29 zle_keymap.c
--- Src/Zle/zle_keymap.c	3 Apr 2008 15:20:24 -0000	1.29
+++ Src/Zle/zle_keymap.c	11 Nov 2008 16:17:43 -0000
@@ -918,11 +918,12 @@
 		    metafy(m, 1, META_NOALLOC);
 		    bindkey(km, m, refthingy(fn), str);
 		}
-		unrefthingy(fn);
 	    }
+	    unrefthingy(fn);
 	} else {
 	    if(bindkey(km, seq, fn, str)) {
 		zwarnnam(name, "cannot bind to an empty key sequence");
+		unrefthingy(fn);
 		ret = 1;
 	    }
 	}



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

only message in thread, other threads:[~2008-11-11 16:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-11 16:31 PATCH: bindkey resource leak Oliver Kiddle

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