about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2008-11-11 22:40:16 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2008-11-11 22:40:16 +0000
commit085419f95d8fd93b3b2ead550512030f22a16a8f (patch)
treec2c3ceb3d484f4971cbc01fdfe6cb5335d6241b0 /Src
parent4b39a04c14c34db7e5f6f81a86f049d2411fdaf1 (diff)
downloadzsh-085419f95d8fd93b3b2ead550512030f22a16a8f.tar.gz
zsh-085419f95d8fd93b3b2ead550512030f22a16a8f.tar.xz
zsh-085419f95d8fd93b3b2ead550512030f22a16a8f.zip
26024: don't leave ref count incremented when aborting bindkey with an error
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/zle_keymap.c3
1 files changed, 2 insertions, 1 deletions
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;
 	    }
 	}