about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/Zle/zle_keymap.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 0c1cd02d9..105592ae6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-11-11  Oliver Kiddle  <opk@zsh.org>
+
+	* 26024: Src/Zle/zle_keymap.c: don't leave reference count
+	incremented when aborting bindkey with an error
+
 2008-11-11  Clint Adams  <clint@zsh.org>
 
 	* 26027: Src/Zle/compctl.c: free pprogc before it goes out of
diff --git a/Src/Zle/zle_keymap.c b/Src/Zle/zle_keymap.c
index 3c8cc4d9d..9dac62049 100644
--- a/Src/Zle/zle_keymap.c
+++ b/Src/Zle/zle_keymap.c
@@ -918,11 +918,12 @@ bin_bindkey_bind(char *name, char *kmname, Keymap km, char **argv, Options ops,
 		    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;
 	    }
 	}